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