1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-10-27 05:10:20 -04:00
toot/tests
Mateusz Piotrowski beeb7914a8 Fix XDG_CONFIG_HOME tests
According to the Python documentation[1]:

> Calls to unsetenv() don’t update os.environ, so it is actually
> preferable to delete items of os.environ.

It means that os.unsetenv is not enough to remove an entry from
os.environ. This is why the following test was failing:

    os.unsetenv('XDG_CONFIG_HOME')
    assert fn() == os.path.expanduser('~/.config/toot/config.json')

os.unsetenv did not influence the output of the subsequent call to
os.getenv() in get_config_file_path(). As a result the original value
was returned instead of the fallback value of '~/.config'.

This bug was discovered during porting toot to FreeBSD as the FreeBSD
Ports framework passes XDG_CONFIG_HOME to make's environment.

[1]: https://docs.python.org/3.6/library/os.html#os.unsetenv
2018-04-17 21:09:26 +02:00
..
__init__.py Add coding directive 2017-04-15 14:53:08 +02:00
test_api.py Fix tests 2017-12-30 18:04:38 +01:00
test_auth.py Reimplement configuration to allow multiple logins 2018-01-02 12:24:32 +01:00
test_config.py Fix XDG_CONFIG_HOME tests 2018-04-17 21:09:26 +02:00
test_console.py Reimplement configuration to allow multiple logins 2018-01-02 12:24:32 +01:00
test_version.py Add __version__ to init file 2018-01-15 12:19:37 +01:00
utils.py Reimplement configuration to allow multiple logins 2018-01-02 12:24:32 +01:00