Esempio n. 1
0
def test_runtime_dir_from_default():
    dirs = xdg.BaseDirs({'HOME': '/home/alice'})
    assert dirs.runtime_dir is None
Esempio n. 2
0
def test_state_home_from_environ():
    dirs = xdg.BaseDirs({'HOME': '/home/alice',
                         'XDG_STATE_HOME': '/foo'})
    assert dirs.state_home == Path('/foo')
Esempio n. 3
0
def test_config_dirs_from_default():
    dirs = xdg.BaseDirs({'HOME': '/home/alice'})
    assert dirs.config_dirs == (Path('/etc/xdg'),)
Esempio n. 4
0
def test_runtime_dir_from_environ():
    dirs = xdg.BaseDirs({'HOME': '/home/alice',
                         'XDG_RUNTIME_DIR': '/foo'})
    assert dirs.runtime_dir == Path('/foo')
Esempio n. 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'))
Esempio n. 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'))
Esempio n. 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'),)
Esempio n. 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'))
Esempio n. 9
0
def test_config_home_from_default():
    dirs = xdg.BaseDirs({'HOME': '/home/alice'})
    assert dirs.config_home == Path('/home/alice/.config')
Esempio n. 10
0
def test_config_home_from_environ():
    dirs = xdg.BaseDirs({'HOME': '/home/alice',
                         'XDG_CONFIG_HOME': '/foo'})
    assert dirs.config_home == Path('/foo')
Esempio n. 11
0
def test_data_home_from_default():
    dirs = xdg.BaseDirs({'HOME': '/home/alice'})
    assert dirs.data_home == Path('/home/alice/.local/share')
Esempio n. 12
0
def test_data_home_from_environ():
    dirs = xdg.BaseDirs({'HOME': '/home/alice',
                         'XDG_DATA_HOME': '/foo'})
    assert dirs.data_home == Path('/foo')
Esempio n. 13
0
def test_state_home_from_default():
    dirs = xdg.BaseDirs({'HOME': '/home/alice'})
    assert dirs.state_home == Path('/home/alice/.local/state')