Esempio n. 1
0
def test_sys_config_dirs():
    """Test that the sys config directories are returned correctly."""
    if "XDG_CONFIG_DIRS" in os.environ:
        del os.environ["XDG_CONFIG_DIRS"]
    config_dirs = get_system_config_dirs(APP_NAME, APP_AUTHOR)
    assert isinstance(config_dirs, list)
    assert config_dirs[0].endswith(APP_NAME) or config_dirs[0].endswith(
        _pathify(APP_NAME))
Esempio n. 2
0
def test_user_config_dir():
    """Test that the config directory is a string with the app name in it."""
    if "XDG_CONFIG_HOME" in os.environ:
        del os.environ["XDG_CONFIG_HOME"]
    config_dir = get_user_config_dir(APP_NAME, APP_AUTHOR)
    assert isinstance(config_dir, text_type)
    assert config_dir.endswith(APP_NAME) or config_dir.endswith(
        _pathify(APP_NAME))