Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ezh committed Feb 23, 2020
1 parent bbaff04 commit a2cea97
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cloudselect/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def adjust(representation, representation_maximum_field_length):
raise AssertionError(
"There should be at least 2 fields in instance representation: id and something meaningful",
)
return [find(i.split("\t", 1)[0]) for i in selected.split("\n")]
return [find(i.split("\t", 1)[0].strip()) for i in selected.split("\n")]

def get_editor(self):
"""Get editor path."""
Expand Down
1 change: 1 addition & 0 deletions test/test_cloudselect.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def test_cli_configuration_read(cfgdir):
"discovery": {
"aws": "cloudselect.discovery.aws",
"hetzner": "cloudselect.discovery.hetzner",
"kubernetes": "cloudselect.discovery.kubernetes",
"local": "cloudselect.discovery.local",
},
"group": {"simple": "cloudselect.group.simple"},
Expand Down
7 changes: 5 additions & 2 deletions test/test_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_completer(capsys):
selector = cloud.fabric(configuration, args)
selector.complete("", 0)
captured = capsys.readouterr()
assert captured.out == "a\nb\nc\nempty\nsingle\n"
assert captured.out == "a\nb\nc\nempty\nk8s\nsingle\n"
assert captured.err == ""


Expand All @@ -35,7 +35,10 @@ def test_profile_list(capsys):
selector = cloud.fabric(configuration, args)
selector.profile_list()
captured = capsys.readouterr()
assert captured.out == "CloudSelect profiles:\n- a\n- b\n- c\n- empty\n- single\n"
assert (
captured.out
== "CloudSelect profiles:\n- a\n- b\n- c\n- empty\n- k8s\n- single\n"
)
assert captured.err == ""


Expand Down

0 comments on commit a2cea97

Please sign in to comment.