Mimesis: Test all the methods of Generic

Created on 16 Jan 2018  路  3Comments  路  Source: lk-geimfari/mimesis

At this moment we test only some methods:

def test_generic_address(self, _generics):
    g1, g2 = _generics
    for _ in range(self.TIMES):
        assert g1.address.street_number() == g2.address.street_number()
        assert g1.address.street_name() == g2.address.street_name()

We should test all the methods of the attributes of Generic to be sure that all works fine.

Must be something like this:

def test_generic_address_all(self, _generics):
    # Logic
    # Test all the methods of provider address dynamically.
enhancement help wanted

All 3 comments

@duckyou Here are we need the same way used in benchmarks, i.e something like this:

@pytest.mark.parametrize(
    'method', (
        m for m in sorted(Provider.__dict__)
        if not m.startswith('_')
    ),
)
def test_method(method):
    # logic

@lk-geimfari Test all methods of generic providers is not so necessary. This tests should check: will be seed argument passed to providers or not.

@duckyou I'll close this issue, but come back to it soon.

We need to test all methods to be sure that all providers work correctly after adding to Generic.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

faheel picture faheel  路  4Comments

lk-geimfari picture lk-geimfari  路  4Comments

lk-geimfari picture lk-geimfari  路  6Comments

lk-geimfari picture lk-geimfari  路  3Comments

lk-geimfari picture lk-geimfari  路  7Comments