Skip to content

Commit ad6a677

Browse files
committed
test: fix hosts test
1 parent 40500a1 commit ad6a677

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

tests/test_cli.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import pytest
44

5+
from audius.cli import hosts
6+
57

68
@pytest.fixture
79
def run_cmd():
@@ -38,14 +40,15 @@ def test_app_name(run_cmd):
3840
assert result.output == "audius-py\n"
3941

4042

41-
def test_hosts(mocker, runner, cli):
43+
def test_hosts(mocker, capsys):
4244
hosts_patch = mocker.patch("audius.cli.get_hosts")
43-
hosts = ["http://host1.example.com", "https://host2.example.com"]
45+
host_strings = ["http://host1.example.com", "https://host2.example.com"]
4446

4547
def patch():
46-
yield from hosts
48+
yield from host_strings
4749

4850
hosts_patch.side_effect = patch
4951

50-
result = runner.invoke(cli, "hosts")
51-
assert result.output == "\n".join(hosts) + "\n"
52+
hosts()
53+
result = capsys.readouterr()
54+
assert result.out == "\n".join(host_strings) + "\n"

0 commit comments

Comments
 (0)