allow cost / set-icon to be displayed in body-top ONLY (#258)

previously, if you used, ie, "--cost=body-top", the cost would show in
the tab AND body-top.  Since the help text implies that the way to
accomplish this should be "--cost=tab --cost=body-top" (and because if you
put it in body-top, it's probably because you want to save space on the
tab)
This commit is contained in:
Paul Molodowitch authored and Peter committed 2019-06-02 15:09:32 -07:00
1 parent b4619bc560
commit 87a2835097
2 files changed
+54 -4

No files matched your search

+44
View File
@@ -32,3 +32,47 @@ def test_sleeved():
assert options.dividerWidth == 9.4 * cm
assert options.labelHeight == 0.9 * cm
assert options.dividerHeight == 6.15 * cm + options.labelHeight
def test_cost():
options = main.parse_opts([])
options = main.clean_opts(options)
assert options.cost == ["tab"]
options = main.parse_opts(["--cost=tab"])
options = main.clean_opts(options)
assert options.cost == ["tab"]
options = main.parse_opts(["--cost=body-top"])
options = main.clean_opts(options)
assert options.cost == ["body-top"]
options = main.parse_opts(["--cost=hide"])
options = main.clean_opts(options)
assert options.cost == ["hide"]
options = main.parse_opts(["--cost=tab", "--cost=body-top"])
options = main.clean_opts(options)
assert set(options.cost) == {"tab", "body-top"}
def test_set_icon():
options = main.parse_opts([])
options = main.clean_opts(options)
assert options.set_icon == ["tab"]
options = main.parse_opts(["--set-icon=tab"])
options = main.clean_opts(options)
assert options.set_icon == ["tab"]
options = main.parse_opts(["--set-icon=body-top"])
options = main.clean_opts(options)
assert options.set_icon == ["body-top"]
options = main.parse_opts(["--set-icon=hide"])
options = main.clean_opts(options)
assert options.set_icon == ["hide"]
options = main.parse_opts(["--set-icon=tab", "--set-icon=body-top"])
options = main.clean_opts(options)
assert set(options.set_icon) == {"tab", "body-top"}