def setUp(self):
     configuration.set_property(is_no_clean_up_enabled,
                                KEEP_TEMPORARY_DIRECTORY)
     temporary_directory = get_temporary_directory()
     self.clean_up_temporary_directory(temporary_directory)
     self.temporary_directory = temporary_directory
     self.create_svn_repo()
    def test_should_set_value_of_configuration_properties(self, mock_get_properties):
        fake_properties = {}
        mock_get_properties.return_value = fake_properties

        set_property('abc', '123')

        self.assertEqual('123', fake_properties['abc'])
Exemplo n.º 3
0
    def test_should_set_value_of_configuration_properties(
            self, mock_get_properties):
        fake_properties = {}
        mock_get_properties.return_value = fake_properties

        set_property('abc', '123')

        self.assertEqual('123', fake_properties['abc'])
    def test_should_load_configuration_if_no_configuration_properties_are_empty(self, mock_load_configuration_file, mock_get_configuration):

        def set_configuration_properties():
            mock_get_configuration.return_value = {}
        mock_load_configuration_file.side_effect = set_configuration_properties
        mock_get_configuration.return_value = None

        set_property('abc', '123')

        mock_load_configuration_file.assert_called_with()
Exemplo n.º 5
0
    def test_should_load_configuration_if_no_configuration_properties_are_empty(
            self, mock_load_configuration_file, mock_get_configuration):
        def set_configuration_properties():
            mock_get_configuration.return_value = {}

        mock_load_configuration_file.side_effect = set_configuration_properties
        mock_get_configuration.return_value = None

        set_property('abc', '123')

        mock_load_configuration_file.assert_called_with()
Exemplo n.º 6
0
def apply_arguments_to_config(arguments):
    """ Overrides configuration properties if command line options are specified. """

    if arguments[OPTION_RPM_UPLOAD_CMD]:
        set_property(get_rpm_upload_command, arguments[OPTION_RPM_UPLOAD_CMD])

    if arguments[OPTION_CONFIG_VIEWER_ONLY]:
        set_property(is_config_viewer_only_enabled, arguments[OPTION_CONFIG_VIEWER_ONLY])

    if arguments[OPTION_NO_CLEAN_UP]:
        set_property(is_no_clean_up_enabled, arguments[OPTION_NO_CLEAN_UP])

    if arguments[OPTION_VERBOSE]:
        set_property(is_verbose_enabled, arguments[OPTION_VERBOSE])
def apply_arguments_to_config(arguments):
    """ Overrides configuration properties if command line options are specified. """

    if arguments[OPTION_RPM_UPLOAD_CMD]:
        set_property(get_rpm_upload_command, arguments[OPTION_RPM_UPLOAD_CMD])

    if arguments[OPTION_CONFIG_VIEWER_ONLY]:
        set_property(is_config_viewer_only_enabled,
                     arguments[OPTION_CONFIG_VIEWER_ONLY])

    if arguments[OPTION_NO_CLEAN_UP]:
        set_property(is_no_clean_up_enabled, arguments[OPTION_NO_CLEAN_UP])

    if arguments[OPTION_VERBOSE]:
        set_property(is_verbose_enabled, arguments[OPTION_VERBOSE])
 def setUp(self):
     configuration.set_property(is_no_clean_up_enabled, KEEP_TEMPORARY_DIRECTORY)
     temporary_directory = get_temporary_directory()
     self.clean_up_temporary_directory(temporary_directory)
     self.temporary_directory = temporary_directory
     self.create_svn_repo()