From f97581d6227b4e93ca5e62b20dd652583deefaea Mon Sep 17 00:00:00 2001 From: Matthew Zipkin Date: Mon, 18 Mar 2024 18:34:04 -0400 Subject: [PATCH] test: raise exception on base.warcli() error --- test/graph_test.py | 2 +- test/test_base.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/graph_test.py b/test/graph_test.py index 1d2af1212..215f978a7 100755 --- a/test/graph_test.py +++ b/test/graph_test.py @@ -24,7 +24,7 @@ file.write(xml) # Validate the graph schema - assert "invalid" not in base.warcli(f"graph validate {Path(tf)}") + assert "invalid" not in base.warcli(f"graph validate {Path(tf)}", False) print(f"Graph at {tf} validated successfully") # Test that the graph actually works diff --git a/test/test_base.py b/test/test_base.py index e9d010367..da8aee186 100644 --- a/test/test_base.py +++ b/test/test_base.py @@ -82,6 +82,9 @@ def warcli(self, str, network=True): if network: cmd += ["--network", self.network_name] proc = run(cmd, capture_output=True) + + if proc.stderr: + raise Exception(proc.stderr.decode().strip()) return proc.stdout.decode().strip() # Execute a warnet RPC API call directly (may return dict or list)