Beispiel #1
0
    def test_resolve_config_location_public_with_extension(self):
        cfg_name = 'myfile.cfg.yml'
        location = cfg_name
        fileoperations.write_to_eb_data_file(location, self.data)

        location = os.path.expanduser(os.getcwd() + os.path.sep +
                                      fileoperations.beanstalk_directory +
                                      location)

        result = saved_configs.resolve_config_location(cfg_name)
        self.assertEqual(result, location)
Beispiel #2
0
    def test_resolve_config_location_private(self):
        cfg_name = 'myfile'
        location = 'saved_configs' + os.path.sep + cfg_name + '.cfg.yml'
        fileoperations.make_eb_dir('saved_configs')
        fileoperations.write_to_eb_data_file(location, self.data)

        location = os.path.expanduser(os.getcwd() + os.path.sep +
                                      fileoperations.beanstalk_directory +
                                      location)

        result = saved_configs.resolve_config_location(cfg_name)
        self.assertEqual(result, location)
Beispiel #3
0
    def test_update_config_resolve_normal(self, mock_upload):
        cfg_name = 'myfile.cfg.yml'
        location = 'saved_configs' + os.path.sep + cfg_name
        fileoperations.make_eb_dir('saved_configs')
        fileoperations.write_to_eb_data_file(location, self.data)

        location = os.getcwd() + os.path.sep + \
                   fileoperations.beanstalk_directory + location

        saved_configs.update_config('app', 'myfile')

        mock_upload.assert_called_with('app', 'myfile', location)
Beispiel #4
0
    def test_resolve_config_location_correct_resolve_with_extension(self):
        cfg_name = 'myfile.cfg.yml'
        location_public = cfg_name
        location_private = 'saved_configs' + os.path.sep + cfg_name
        fileoperations.make_eb_dir('saved_configs')
        fileoperations.write_to_eb_data_file(location_public, self.data)
        fileoperations.write_to_eb_data_file(location_private, self.data)

        location_public = os.getcwd() + os.path.sep + \
            fileoperations.beanstalk_directory + location_public
        location_private = os.getcwd() + os.path.sep + \
            fileoperations.beanstalk_directory + location_private

        result = saved_configs.resolve_config_location(cfg_name)
        self.assertEqual(result, location_private)
Beispiel #5
0
def write_to_local_config(cfg_name, data):
    fileoperations.make_eb_dir(SAVED_CONFIG_FOLDER_NAME)

    file_location = SAVED_CONFIG_FOLDER_NAME + cfg_name + '.cfg.yml'
    fileoperations.write_to_eb_data_file(file_location, data)
    return fileoperations.get_eb_file_full_location(file_location)
def write_to_local_config(cfg_name, data):
    fileoperations.make_eb_dir(SAVED_CONFIG_FOLDER_NAME)

    file_location = SAVED_CONFIG_FOLDER_NAME + cfg_name + '.cfg.yml'
    fileoperations.write_to_eb_data_file(file_location, data)
    return fileoperations.get_eb_file_full_location(file_location)