Source

pida-main / tests / core / test_environment.py

Full commit
import pytest
from pida.core.environment import (
    home, set_home,
    firstrun_file,
    settings_dir,
    plugins_path,
)


def test_home(tmpdir):
    assert home() != tmpdir
    set_home(tmpdir)
    assert home() == tmpdir

def test_firstrun_file():
    assert firstrun_file() == home('first_run_wizard')
    with pytest.raises(TypeError):
        firstrun_file('test')

def test_settings_dir():
    assert settings_dir() == home('settings')
    assert settings_dir('test') == home('settings', 'test')


def test_plugins_path():
    print plugins_path
    assert home('plugins') in plugins_path