Esempio n. 1
0
 def setUp(self):
     self.sut = RecipeHasSubrecipe
     self.recipe1 = RecipeDataProvider.get().with_id(1).build()
     self.recipe2 = RecipeDataProvider.get().with_id(2).with_allergens(
         'allergens').build()
     self.recipe2.chef = ChefDataProvider.getDefault()
     self.order = 0
Esempio n. 2
0
 def setUp(self):
     super(BookRepositoryTest, self).setUp()
     self.chef = ChefDataProvider.getDefault()
     self.chef.id = 9999
     self.chef.save()
     self.sut = BookRepository.new()
     self.test_material = self.exercise_create_book_with_recipes()
 def test_get_costing_table_shouldCallWithRepositoryMethod(self):
     chef = ChefDataProvider.getDefault()
     self.repositoryStub.find_by_chef_id.return_value = 'result'
     actual = self.sut.get_costing_table(chef, 'filter', 2)
     self.repositoryStub.find_by_chef_id.assert_called_with(chef_id=chef.id,
                                                            filter='filter',
                                                            page=2)
     self.assertEqual(actual, 'result')
    def setUp(self):
        super(RecipeSubrecipeRepositoryTest, self).setUp()
        self.sut = RecipeHasSubrecipeRepository.new()
        self.recipe1 = RecipeDataProvider.get().with_id(1).build()
        self.recipe2 = RecipeDataProvider.get().with_id(2).with_allergens(
            'allergens').build()
        self.recipe2.chef = ChefDataProvider.getDefault()
        self.order = 1

        RecipeHasSubrecipeDataProvider.get().with_recipe_id(1).with_price(
            100).build().save()
        RecipeHasSubrecipeDataProvider.get().with_recipe_id(1).with_price(
            100).build().save()
        RecipeHasSubrecipeDataProvider.get().with_recipe_id(1).with_price(
            100).build().save()
        RecipeHasSubrecipeDataProvider.get().with_recipe_id(2).with_price(
            100).build().save()
        RecipeHasSubrecipeDataProvider.get().with_recipe_id(3).with_price(
            100).build().save()
 def test_count_suggestion_list_should_returnExpected(self):
     chef = ChefDataProvider.getDefault()
     self.repositoryStub.count_by_chef_id.return_value = 100
     actual = self.sut.count_suggestion_list(chef, '')
     self.assertEqual(actual, 100)
 def test_get_suggestion_list_should_returnExpected(self):
     chef = ChefDataProvider.getDefault()
     self.repositoryStub.find_by_chef_id.return_value = []
     actual = self.sut.get_suggestion_list(chef, '', 5)
     self.assertEqual(actual, [])
Esempio n. 7
0
 def setUp(self):
     self.sut = ChefEntity()
     self.CHEF = ChefDataProvider.getDefault()
 def test_count_suggestion_list_should_returnExpected_whenHasNoMore(self):
     chef = ChefDataProvider.getDefault()
     self.recipe_suggestion_view_repository_stub.count_by_chef.return_value = 100
     actual = self.sut.count_suggestion_list(chef, '')
     self.assertEqual(actual, 100)