Exemple #1
0
def test_generators_detection(attribute: str, content_type: tuple, items: int):
    pack = Content(TEST_CONTENT_REPO)
    generator_as_list = list(pack.__getattribute__(attribute))
    # Check detect all objects
    assert len(generator_as_list) == items
    # Check all objects detected correctly
    for item in generator_as_list:
        assert isinstance(item, content_type)
Exemple #2
0
def test_detection(attribute: str, content_type: type):
    pack = Content(TEST_CONTENT_REPO)
    assert isinstance(pack.__getattribute__(attribute), content_type)