Giter Club home page Giter Club logo

expycted's Introduction

expycted's People

Contributors

bdsoha avatar petereon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

expycted's Issues

Refactor Tests

  • Use utilities to shorten test cases
  • Cleanup duplicates
  • Refactor filesystem fixtures
  • get_singleton has no effect
  • Add tests for alias

Rewrite `be` as matcher

Instead of checking equivalence, the matcher should use the IsMatcher to check exact equality.

This will be a breaking change.

The logic from the current be implementation should be moved to the weak qualifier of equals.

Add documentation as a static site on GitHub pages

Add documentation as a static site on GitHub pages.

  • Add CI deployment to GitHub pages
  • Add a custom CNAME record
  • Create docs directory with .md files and VitePress
  • Refactor the main readme to point the documentation site
  • Remove the PYPIREADME.md
  • #69

Pages

  • Introduction / What is Expycted?
  • Introduction / Installation
  • Introduction / Getting Started
  • Expectations / Overview + Available Expectations
  • Expectations / Strict Mode
  • Expectations / Higher Order Tests
  • Expectations / Interface / Main
  • Expectations / Interface / Chains
  • Expectations / Interface / Filesystem
  • Expectations / Interface / Functions
  • Get Involved / Introduction (issues/bugs/docs)
  • Get Involved / Development Install
  • Get Involved / Contribution Workflow
  • Get Involved / Pull Request Guidelines

Expycted would benefit from some functionality

Needed:

  • Testing folder contents
  • Testing whether nested dictionaries have user defined structure/contain some "path" (Pydantic already handles this well enough)

Nice to have:

  • Testing click CLI tools approachably (Just doesn't sound interesting enough in hindsight)
  • Testing API responses (Can be done using already available matchers and some minor additional logic, not substantial enough for the effort)

Add typing to decorators

Add generic typing to:

  • assertion_property
  • matcher_proxy
  • Add type checks for mypy
  • Test in vscode
  • Test in PyCharm

Allow higher-order expectations

Allow higher-order expectations to assert all values in an iterable item using syntax expect([1,2,3]).each.to_be_numeric(3).

  • Add a chain method for .each to assert each value independently
  • Add a chain method for .all as an alias to .each
  • Add a chain method for .any to assert that at least one value conforms to the expectation

Allow assertion method chaining

Allow assertion method chaining:

expect([1, 2, 3]).to.contain(3).and_to_not.contain(7)
# expect([1, 2, 3]).to.contain(3).and_not.contain(7)
# expect([1, 2, 3]).to.contain(3).and_to.contain(2)

Add chains:

  • and_to
  • and_to_not
  • and_not

Add additional expectations

Add additional expectations:

  • to_be_list()
  • to_be_tuple()
  • to_be_set()
  • to_be_dict()
  • to_have_length()
  • to_have_attribute()
  • to_have_attributes()
  • to_almost_equal()
  • to_be_instanceof()
  • to_be_bool()
  • to_be_numeric() # Strict
  • to_be_callable()
  • to_be_int()
  • to_be_float()
  • to_be_str()
  • to_be_none()
  • to_startwith()
  • to_endwith()
  • to_match() # regex
  • add documentation

Reset negated state after each assertion

Reset negated state after each assertion.

Assuming:

def test():
    data = ['hello']

    # Using the `assert` keyword
    assert isinstance(data, list)
    assert len(data) == 1
    assert 'hello' in data
    assert 'world' not in data

    # Using expectations
    expect(data) \
        .to.be_a_list() \
        .and_to.have_len(1) \
        .and_not.contain('world') \
        .and_to.contain('hello') \

This will currently fail due to the chained functionally of .and_not.contain('world') maintaining the negated stated.

Rewrite core internals

Rewrite core internals in a more object oriented fashion.

  • Move the responsibility for evaluating (comparing actual and expected) from BaseExpectation to a new base class
class BaseMatcher:
    def message(self, *, actual=None, **kwargs) -> str:
        ...

    def _match(self, *, actual=None, **kwargs):
        ...

    def _negate(self, *, actual=None, **kwargs):
        ...

    def __call__(self, *, actual=None, **kwargs) -> bool:
       ...

Move away from Poetry and Pipenv

Move away from the use of Poetry and Pipenv as part of the development workflow.
Such solutions are great, but the choice of a development work-belt should be that of the developer and not opinionated.

Instead, move to vanilla Python.

  • Replace Poetry in pyproject.toml
  • Migrate Pipenv into pyproject.toml
  • Add [project.optional-dependencies] for test and ci dependencies
  • Extract version using dynamic = ["version"] from a __version__ variable
  • Update CI workflows
  • Update .gitignore

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.