Exemple #1
0
def test_runtime_dir_from_default():
    dirs = xdg.BaseDirs({'HOME': '/home/alice'})
    assert dirs.runtime_dir is None
Exemple #2
0
def test_state_home_from_environ():
    dirs = xdg.BaseDirs({'HOME': '/home/alice',
                         'XDG_STATE_HOME': '/foo'})
    assert dirs.state_home == Path('/foo')
Exemple #3
0
def test_config_dirs_from_default():
    dirs = xdg.BaseDirs({'HOME': '/home/alice'})
    assert dirs.config_dirs == (Path('/etc/xdg'),)
Exemple #4
0
def test_runtime_dir_from_environ():
    dirs = xdg.BaseDirs({'HOME': '/home/alice',
                         'XDG_RUNTIME_DIR': '/foo'})
    assert dirs.runtime_dir == Path('/foo')
Exemple #5
0
def test_data_dirs_from_default():
    dirs = xdg.BaseDirs({'HOME': '/home/alice'})
    assert dirs.data_dirs == (Path('/usr/local/share'), Path('/usr/share'))
Exemple #6
0
def test_config_dirs_from_environ_many():
    dirs = xdg.BaseDirs({'HOME': '/home/alice',
                         'XDG_CONFIG_DIRS': '/foo:/bar'})
    assert dirs.config_dirs == (Path('/foo'), Path('/bar'))
Exemple #7
0
def test_data_dirs_from_environ_single():
    dirs = xdg.BaseDirs({'HOME': '/home/alice',
                         'XDG_DATA_DIRS': '/foo'})
    assert dirs.data_dirs == (Path('/foo'),)
Exemple #8
0
def test_data_dirs_from_environ_many():
    dirs = xdg.BaseDirs({'HOME': '/home/alice',
                         'XDG_DATA_DIRS': '/foo:/bar'})
    assert dirs.data_dirs == (Path('/foo'), Path('/bar'))
Exemple #9
0
def test_config_home_from_default():
    dirs = xdg.BaseDirs({'HOME': '/home/alice'})
    assert dirs.config_home == Path('/home/alice/.config')
Exemple #10
0
def test_config_home_from_environ():
    dirs = xdg.BaseDirs({'HOME': '/home/alice',
                         'XDG_CONFIG_HOME': '/foo'})
    assert dirs.config_home == Path('/foo')
Exemple #11
0
def test_data_home_from_default():
    dirs = xdg.BaseDirs({'HOME': '/home/alice'})
    assert dirs.data_home == Path('/home/alice/.local/share')
Exemple #12
0
def test_data_home_from_environ():
    dirs = xdg.BaseDirs({'HOME': '/home/alice',
                         'XDG_DATA_HOME': '/foo'})
    assert dirs.data_home == Path('/foo')
Exemple #13
0
def test_state_home_from_default():
    dirs = xdg.BaseDirs({'HOME': '/home/alice'})
    assert dirs.state_home == Path('/home/alice/.local/state')