def test_search_config_default(self): tc.delete_it(self.third_conf) tc.delete_it(self.second_conf) tc.delete_it(self.first_conf) tc.delete_it(self.home_conf) tc.delete_it(self.home_pakit_conf) assert search_for_config(1) == 1
def env_config_setup(): """ Copies config to first position looked, `./.pakit.yml` Ensures NO other configuration possibly considered. NB: Not covered by tests, essentially just search_for_config with some file moves. """ global PAKIT_CONFS conf_file = search_for_config(1) while conf_file != 1: shutil.move(conf_file, conf_file + '_bak') PAKIT_CONFS.append(conf_file) conf_file = search_for_config(1) config_dst = '.pakit.yml' shutil.copy(TEST_CONFIG, config_dst)
def test_search_config_one_up(self): tc.delete_it(self.third_conf) assert search_for_config() == self.second_conf
def test_search_config_home(self): tc.delete_it(self.third_conf) tc.delete_it(self.second_conf) tc.delete_it(self.first_conf) assert search_for_config() == self.home_conf
def test_search_config_cur_dir(self): assert search_for_config() == self.third_conf