Esempio n. 1
0
    def test_extend_configfile(self, mock_open, mock_config_parser,
                               mock_add_extra_options, mock_string_io):
        extra_options = mock.Mock()
        conf_path = "/path/to/fake/conf"

        utils.extend_configfile(extra_options, conf_path)

        conf = mock_config_parser.return_value
        conf.read.assert_called_once_with(conf_path)

        mock_add_extra_options.assert_called_once_with(extra_options, conf)
        conf = mock_add_extra_options.return_value
        conf.write.assert_has_calls([mock.call(mock_open.side_effect()),
                                     mock.call(mock_string_io.return_value)])
        mock_string_io.return_value.getvalue.assert_called_once_with()
Esempio n. 2
0
    def test_extend_configfile(self, mock_open, mock_config_parser,
                               mock_add_extra_options, mock_string_io):
        extra_options = mock.Mock()
        conf_path = "/path/to/fake/conf"

        utils.extend_configfile(extra_options, conf_path)

        conf = mock_config_parser.return_value
        conf.read.assert_called_once_with(conf_path)

        mock_add_extra_options.assert_called_once_with(extra_options, conf)
        conf = mock_add_extra_options.return_value
        conf.write.assert_has_calls([
            mock.call(mock_open.side_effect()),
            mock.call(mock_string_io.return_value)
        ])
        mock_string_io.return_value.getvalue.assert_called_once_with()
Esempio n. 3
0
 def extend_configuration(self, extra_options):
     """Extend Tempest configuration with extra options."""
     return utils.extend_configfile(extra_options, self.configfile)
Esempio n. 4
0
 def extend_configuration(self, extra_options):
     """Extend Tempest configuration with extra options."""
     return utils.extend_configfile(extra_options, self.configfile)