summaryrefslogtreecommitdiff
path: root/tests/unit/config/test_configcommands.py
diff options
context:
space:
mode:
authorJay Kamat <jaygkamat@gmail.com>2019-07-03 17:37:37 -0700
committerJay Kamat <jaygkamat@gmail.com>2019-07-03 17:37:37 -0700
commit76c3de4b8479e309f0d899ba163eb2d09df2b15a (patch)
tree558104d2bb66833f78b54bbb4958c11df323db5e /tests/unit/config/test_configcommands.py
parentf35eba0d60b0150c3a1fdf6352a958d0882b3286 (diff)
parent012f11ab31146f4fce9a5d9fc67c5ef86986d90a (diff)
downloadqutebrowser-76c3de4b8479e309f0d899ba163eb2d09df2b15a.tar.gz
qutebrowser-76c3de4b8479e309f0d899ba163eb2d09df2b15a.zip
Merge branch 'master' of https://github.com/qutebrowser/qutebrowser into config-cli-option
Diffstat (limited to 'tests/unit/config/test_configcommands.py')
-rw-r--r--tests/unit/config/test_configcommands.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/unit/config/test_configcommands.py b/tests/unit/config/test_configcommands.py
index bbc3159e6..f11410622 100644
--- a/tests/unit/config/test_configcommands.py
+++ b/tests/unit/config/test_configcommands.py
@@ -1,5 +1,5 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
-# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
+# Copyright 2014-2019 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# This file is part of qutebrowser.
#
@@ -299,6 +299,12 @@ class TestAdd:
else:
assert yaml_value(name)[-1] == value
+ def test_list_add_invalid_option(self, commands):
+ with pytest.raises(
+ cmdutils.CommandError,
+ match="No option 'nonexistent'"):
+ commands.config_list_add('nonexistent', 'value')
+
def test_list_add_non_list(self, commands):
with pytest.raises(
cmdutils.CommandError,
@@ -342,6 +348,12 @@ class TestAdd:
"overwrite!"):
commands.config_dict_add(name, key, value, replace=False)
+ def test_dict_add_invalid_option(self, commands):
+ with pytest.raises(
+ cmdutils.CommandError,
+ match="No option 'nonexistent'"):
+ commands.config_dict_add('nonexistent', 'key', 'value')
+
def test_dict_add_non_dict(self, commands):
with pytest.raises(
cmdutils.CommandError,
@@ -371,6 +383,12 @@ class TestRemove:
else:
assert value not in yaml_value(name)
+ def test_list_remove_invalid_option(self, commands):
+ with pytest.raises(
+ cmdutils.CommandError,
+ match="No option 'nonexistent'"):
+ commands.config_list_remove('nonexistent', 'value')
+
def test_list_remove_non_list(self, commands):
with pytest.raises(
cmdutils.CommandError,
@@ -396,6 +414,12 @@ class TestRemove:
else:
assert key not in yaml_value(name)
+ def test_dict_remove_invalid_option(self, commands):
+ with pytest.raises(
+ cmdutils.CommandError,
+ match="No option 'nonexistent'"):
+ commands.config_dict_remove('nonexistent', 'key')
+
def test_dict_remove_non_dict(self, commands):
with pytest.raises(
cmdutils.CommandError,