Example #1
0
    def test_successful_file_list(self):
        '''Tests calling RecipeData.add_input_to_data() successfully with a file list parameter'''

        recipe_input_name = u'foo'
        file_ids = [1, 2, 3, 4]
        job_input_name = u'bar'

        recipe_data = RecipeData({u'input_data': [{u'name': recipe_input_name, u'file_ids': file_ids}]})
        job_data = MagicMock()
        
        recipe_data.add_input_to_data(recipe_input_name, job_data, job_input_name)
        job_data.add_file_list_input.assert_called_with(job_input_name, file_ids)
Example #2
0
    def test_successful_property(self):
        '''Tests calling RecipeData.add_input_to_data() successfully with a property parameter'''

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

        recipe_data = RecipeData({u'input_data': [{u'name': recipe_input_name, u'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)
Example #3
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 = RecipeData({'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)
Example #4
0
    def test_successful_file_list(self):
        """Tests calling RecipeData.add_input_to_data() successfully with a file list parameter"""

        recipe_input_name = 'foo'
        file_ids = [1, 2, 3, 4]
        job_input_name = 'bar'

        recipe_data = RecipeData({'input_data': [{'name': recipe_input_name, 'file_ids': file_ids}]})
        job_data = MagicMock()
        
        recipe_data.add_input_to_data(recipe_input_name, job_data, job_input_name)
        job_data.add_file_list_input.assert_called_with(job_input_name, file_ids)
Example #5
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 = RecipeData({"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)
Example #6
0
    def test_successful_file_list(self):
        """Tests calling RecipeData.add_input_to_data() successfully with a file list parameter"""

        recipe_input_name = "foo"
        file_ids = [1, 2, 3, 4]
        job_input_name = "bar"

        recipe_data = RecipeData({"input_data": [{"name": recipe_input_name, "file_ids": file_ids}]})
        job_data = MagicMock()

        recipe_data.add_input_to_data(recipe_input_name, job_data, job_input_name)
        job_data.add_file_list_input.assert_called_with(job_input_name, file_ids)
Example #7
0
    def test_successful_file(self):
        '''Tests calling RecipeData.add_input_to_data() successfully with a file parameter'''

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

        recipe_data = RecipeData({
            u'input_data': [{
                u'name': recipe_input_name,
                u'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)