summaryrefslogtreecommitdiff
path: root/tests/unit/config/test_configcommands.py
diff options
context:
space:
mode:
authorÁrni Dagur <agudmundsson@fc-md.umd.edu>2020-06-21 01:44:24 -0400
committerÁrni Dagur <arni@dagur.eu>2020-12-19 20:23:17 +0000
commit12e1b157e746658faef3b491da848dff18fa91c7 (patch)
treed7d5e873e4c4e63ff778ccde2a8d2c8317c499eb /tests/unit/config/test_configcommands.py
parent2ac0edb68e675a93575c60a0481a768a4f8a64ba (diff)
parenta6817bd0865719bc1dc3a272fd8ab85c0d139937 (diff)
downloadqutebrowser-12e1b157e746658faef3b491da848dff18fa91c7.tar.gz
qutebrowser-12e1b157e746658faef3b491da848dff18fa91c7.zip
Merge branch 'master' into more-sophisticated-adblock
Diffstat (limited to 'tests/unit/config/test_configcommands.py')
-rw-r--r--tests/unit/config/test_configcommands.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/unit/config/test_configcommands.py b/tests/unit/config/test_configcommands.py
index f896cf4ad..cb2608145 100644
--- a/tests/unit/config/test_configcommands.py
+++ b/tests/unit/config/test_configcommands.py
@@ -212,6 +212,16 @@ class TestSet:
commands.set(win_id=0, option='foo?')
+@pytest.mark.parametrize('old', [True, False])
+def test_diff(commands, tabbed_browser_stubs, old):
+ """Run ':config-diff'.
+
+ Should open qute://configdiff."""
+ commands.config_diff(win_id=0, old=old)
+ url = QUrl('qute://configdiff/old') if old else QUrl('qute://configdiff')
+ assert tabbed_browser_stubs[0].loaded_url == url
+
+
class TestCycle:
"""Test :config-cycle."""
@@ -625,6 +635,19 @@ class TestWritePy:
lines = confpy.read_text('utf-8').splitlines()
assert '# Autogenerated config.py' in lines
+ @pytest.mark.posix
+ def test_expanduser(self, commands, monkeypatch, tmpdir):
+ """Make sure that using a path with ~/... works correctly."""
+ home = tmpdir / 'home'
+ home.ensure(dir=True)
+ monkeypatch.setenv('HOME', str(home))
+
+ commands.config_write_py('~/config.py')
+
+ confpy = home / 'config.py'
+ lines = confpy.read_text('utf-8').splitlines()
+ assert '# Autogenerated config.py' in lines
+
def test_existing_file(self, commands, tmpdir):
confpy = tmpdir / 'config.py'
confpy.ensure()