示例#1
0
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)
示例#2
0
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)
示例#3
0
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)
示例#4
0
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')))
示例#5
0
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)
示例#6
0
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"))
    )