Example #1
0
    def test_increment(self, unique):
        id_count = unique.id_count
        items_total = 10
        items = list()
        for i in range(items_total):
            items.append(Unique())

        assert len(items) == items_total
        for i in range(items_total):
            assert items[i].id == i + 1 + id_count
        for item in items:
            assert (item.id != existing_item.id for existing_item in items)
Example #2
0
    def test_id(self, id):
        obj = Unique()
        original_id = obj.id
        obj.id = id

        assert obj.id == original_id
Example #3
0
 def test_unique(self, unique):
     assert unique.id == 1
     unique = None
     assert Unique().id != 1
Example #4
0
 def unique(self):
     yield Unique()