Example #1
0
class TestCategory:
    def setup_method(self, method):
        self.category = Category('food')

    def test_category(self):
        assert isinstance(self.category, Category)
        assert self.category.__repr__() == 'food'
        assert self.category.__len__() == 0

    def test_add(self):
        self.category.add(name='soup', ingredients=['water'])
        assert self.category.__len__() == 1
Example #2
0
 def setup_method(self, method):
     self.category = Category('food')