Esempio n. 1
0
    def test_successful_property(self):
        """Tests calling RecipeData.add_input_to_data() successfully with a property parameter"""

        recipe_input_name = 'foo'
        value = 'Doctor Who?'
        job_input_name = 'bar'

        recipe_data = LegacyRecipeData(
            {'input_data': [{
                'name': recipe_input_name,
                'value': value
            }]})
        job_data = MagicMock()

        recipe_data.add_input_to_data(recipe_input_name, job_data,
                                      job_input_name)
        job_data.add_property_input.assert_called_with(job_input_name, value)
Esempio n. 2
0
    def test_successful_file(self):
        """Tests calling RecipeData.add_input_to_data() successfully with a file parameter"""

        recipe_input_name = 'foo'
        file_id = 1337
        job_input_name = 'bar'

        recipe_data = LegacyRecipeData(
            {'input_data': [{
                'name': recipe_input_name,
                'file_id': file_id
            }]})
        job_data = MagicMock()

        recipe_data.add_input_to_data(recipe_input_name, job_data,
                                      job_input_name)
        job_data.add_file_input.assert_called_with(job_input_name, file_id)