Exemplo n.º 1
0
def test_get_touchpad_defaults_existing_without_filename(tmpdir):
    with config_home(tmpdir):
        defaults_file = py.path.local(config.get_touchpad_defaults_file_path())
        data = {'spam': 'eggs'}
        defaults_file.write(json.dumps(data))
        assert defaults_file.check(exists=True, file=True)
        assert config.get_touchpad_defaults() == data
Exemplo n.º 2
0
def test_get_touchpad_defaults_existing_without_filename(tmpdir):
    with config_home(tmpdir):
        defaults_file = py.path.local(config.get_touchpad_defaults_file_path())
        data = {"spam": "eggs"}
        defaults_file.write(json.dumps(data))
        assert defaults_file.check(exists=True, file=True)
        assert config.get_touchpad_defaults() == data
Exemplo n.º 3
0
def test_get_touchpad_defaults_existing_with_filename(tmpdir):
    test_file = tmpdir.join('test.json')
    data = {'spam': 'eggs'}
    test_file.write(json.dumps(data))
    assert test_file.check(exists=True, file=True)
    assert config.get_touchpad_defaults(str(test_file)) == data
Exemplo n.º 4
0
def test_get_touchpad_defaults_non_existing_without_filename(tmpdir):
    with config_home(tmpdir) as config_home_dir:
        assert config.get_touchpad_defaults() == {}
        assert config_home_dir.check(exists=True, dir=True)
Exemplo n.º 5
0
def test_get_touchpad_defaults_non_existing_with_filename(tmpdir):
    test_file = tmpdir.join('test.json')
    assert test_file.check(exists=False)
    assert config.get_touchpad_defaults(str(test_file)) == {}
Exemplo n.º 6
0
def test_get_touchpad_defaults_existing_with_filename(tmpdir):
    test_file = tmpdir.join("test.json")
    data = {"spam": "eggs"}
    test_file.write(json.dumps(data))
    assert test_file.check(exists=True, file=True)
    assert config.get_touchpad_defaults(str(test_file)) == data
Exemplo n.º 7
0
def test_get_touchpad_defaults_non_existing_without_filename(tmpdir):
    with config_home(tmpdir) as config_home_dir:
        assert config.get_touchpad_defaults() == {}
        assert config_home_dir.check(exists=True, dir=True)
Exemplo n.º 8
0
def test_get_touchpad_defaults_non_existing_with_filename(tmpdir):
    test_file = tmpdir.join("test.json")
    assert test_file.check(exists=False)
    assert config.get_touchpad_defaults(str(test_file)) == {}