aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-12-14 15:06:41 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:54 +0100
commit57ad5138dc9bb5aa85ae4f58ee022f2ea2003b5d (patch)
treeabba0fe0258afb1fcbf88e3b7eb656a8ae677cb2 /tests
parent71883e46b99a46e297a790fed59d27f1b85c92a5 (diff)
downloadwee-slack-57ad5138dc9bb5aa85ae4f58ee022f2ea2003b5d.tar.gz
Set options value to True if it's set without a value
It became very confusing to use None to represent it being set without a value, so use True instead. If it has a value it will always be a string, so you can still distinguish between an option without a value and an option with a truthy value.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_commands.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py
index fe3e917..5868b56 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -22,13 +22,13 @@ def test_parse_options_without_options():
def test_parse_options_with_option():
pos_args, options = parse_options("workspace add wee-slack-test -autoconnect")
assert pos_args == "workspace add wee-slack-test"
- assert options == {"autoconnect": None}
+ assert options == {"autoconnect": True}
def test_parse_options_option_in_middle():
pos_args, options = parse_options("workspace add -autoconnect wee-slack-test")
assert pos_args == "workspace add wee-slack-test"
- assert options == {"autoconnect": None}
+ assert options == {"autoconnect": True}
def test_parse_options_option_with_value():
@@ -36,4 +36,4 @@ def test_parse_options_option_with_value():
"workspace add wee-slack-test -autoconnect -api_token=xoxp-1"
)
assert pos_args == "workspace add wee-slack-test"
- assert options == {"autoconnect": None, "api_token": "xoxp-1"}
+ assert options == {"autoconnect": True, "api_token": "xoxp-1"}