We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40500a1 commit ad6a677Copy full SHA for ad6a677
1 file changed
tests/test_cli.py
@@ -2,6 +2,8 @@
2
3
import pytest
4
5
+from audius.cli import hosts
6
+
7
8
@pytest.fixture
9
def run_cmd():
@@ -38,14 +40,15 @@ def test_app_name(run_cmd):
38
40
assert result.output == "audius-py\n"
39
41
42
-def test_hosts(mocker, runner, cli):
43
+def test_hosts(mocker, capsys):
44
hosts_patch = mocker.patch("audius.cli.get_hosts")
- hosts = ["http://host1.example.com", "https://host2.example.com"]
45
+ host_strings = ["http://host1.example.com", "https://host2.example.com"]
46
47
def patch():
- yield from hosts
48
+ yield from host_strings
49
50
hosts_patch.side_effect = patch
51
- result = runner.invoke(cli, "hosts")
- 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