예제 #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
예제 #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
예제 #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
예제 #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)
예제 #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)) == {}
예제 #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
예제 #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)
예제 #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)) == {}