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)
def test_id(self, id): obj = Unique() original_id = obj.id obj.id = id assert obj.id == original_id
def test_unique(self, unique): assert unique.id == 1 unique = None assert Unique().id != 1
def unique(self): yield Unique()