示例#1
0
    def test_resolve_config_location_relative_without_slash(self):
        cfg_name = 'myfile.cfg.yml'
        location = fileoperations.get_project_file_full_location(cfg_name)
        fileoperations.write_to_data_file(location, self.data)

        result = saved_configs.resolve_config_location(cfg_name)
        self.assertEqual(result, location)
示例#2
0
    def test_resolve_config_location_full_path(self):
        location = os.path.expanduser(os.getcwd() + os.path.sep +
                                      'myfile.cfg.yml')
        fileoperations.write_to_data_file(location, self.data)

        result = saved_configs.resolve_config_location(location)
        self.assertEqual(result, location)
示例#3
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)
示例#4
0
    def test_resolve_config_location_none(self):
        location = 'badlocation'

        result = saved_configs.resolve_config_location(location)
        self.assertEqual(result, None)