def assert_config_file_path(file_path, name): __tracebackhide__ = True if isinstance(file_path, basestring): file_path = py.path.local(file_path) assert file_path.check(exists=False) assert file_path.basename == name assert file_path.dirpath() == py.path.local(config.get_configuration_directory()) assert file_path.dirpath().check(dir=True, exists=True)
def assert_config_file_path(file_path, name): __tracebackhide__ = True if isinstance(file_path, basestring): file_path = py.path.local(file_path) assert file_path.check(exists=False) assert file_path.basename == name assert file_path.dirpath() == py.path.local( config.get_configuration_directory()) assert file_path.dirpath().check(dir=True, exists=True)
def test_get_configuration_directory_nondefault(tmpdir): with config_home(tmpdir) as config_home_dir: assert config_home_dir.check(exists=False) config_directory = py.path.local(config.get_configuration_directory()) assert config_directory == config_home_dir.join('synaptiks') assert config_directory.check(exists=True, dir=True)
def test_get_configuration_directory_default(): directory = config.get_configuration_directory() assert os.path.normpath(directory) == os.path.normpath( os.path.expanduser(os.path.join('~', '.config', 'synaptiks')))
def test_get_configuration_directory_nondefault(tmpdir): with config_home(tmpdir) as config_home_dir: assert config_home_dir.check(exists=False) config_directory = py.path.local(config.get_configuration_directory()) assert config_directory == config_home_dir.join("synaptiks") assert config_directory.check(exists=True, dir=True)
def test_get_configuration_directory_default(): directory = config.get_configuration_directory() assert os.path.normpath(directory) == os.path.normpath( os.path.expanduser(os.path.join("~", ".config", "synaptiks")) )