summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Duraffort <remi.duraffort@linaro.org>2018-05-03 11:28:24 +0200
committerRémi Duraffort <remi.duraffort@linaro.org>2018-05-03 11:28:24 +0200
commitc0fabbd7d7d7997c33a1db5cfa64779c60083920 (patch)
tree60beec5fabd8b585125c854016d189a9dd2d3ed6
parent57639bdfee0626dcb055733e47e33390d895b1e5 (diff)
Fix more compatibility issues
Change-Id: I2639d9adf67a4c381417849cdf5ac680759e6bcb
-rw-r--r--tests/test_device_types.py4
-rw-r--r--tests/test_events.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_device_types.py b/tests/test_device_types.py
index baf690d..f79d463 100644
--- a/tests/test_device_types.py
+++ b/tests/test_device_types.py
@@ -125,7 +125,7 @@ def test_dt_hc_get_before_2018_4(setup, monkeypatch, capsys):
"ret": []}])
with pytest.raises(SystemExit):
main()
- assert capsys.readouterr().err == """usage: lavacli device-types [-h] {add,aliases,list,show,template,update} ...
+ assert capsys.readouterr()[1] == """usage: lavacli device-types [-h] {add,aliases,list,show,template,update} ...
lavacli device-types: error: argument sub_sub_command: invalid choice: 'health-check' (choose from 'add', 'aliases', 'list', 'show', 'template', 'update')
"""
@@ -139,7 +139,7 @@ def test_dt_hc_set_before_2018_4(setup, monkeypatch, capsys):
"ret": []}])
with pytest.raises(SystemExit):
main()
- assert capsys.readouterr().err == """usage: lavacli device-types [-h] {add,aliases,list,show,template,update} ...
+ assert capsys.readouterr()[1] == """usage: lavacli device-types [-h] {add,aliases,list,show,template,update} ...
lavacli device-types: error: argument sub_sub_command: invalid choice: 'health-check' (choose from 'add', 'aliases', 'list', 'show', 'template', 'update')
"""
diff --git a/tests/test_events.py b/tests/test_events.py
index da67d14..013c0ba 100644
--- a/tests/test_events.py
+++ b/tests/test_events.py
@@ -111,7 +111,7 @@ def test_events_listen_config_2(setup, monkeypatch, capsys, tmpdir):
monkeypatch.setattr(sys, "argv", ["lavacli", "events", "listen"])
monkeypatch.setattr(zmq, "Context", lambda : DummyContext())
monkeypatch.setattr(DummySocket, "url", "tcp://localhost:789")
- with open(tmpdir / "lavacli.yaml", "w") as f_conf:
+ with open(str(tmpdir / "lavacli.yaml"), "w") as f_conf:
f_conf.write("default:\n username: admin\n token: 12345\n uri: https://localhost:456/RPC2\n events:\n uri: tcp://localhost:789\n")
monkeypatch.setattr(xmlrpc.client.ServerProxy, "data", [{"request": "system.version", "args": (), "ret": version}])
assert main() == 1