Skip to content

Commit

Permalink
Improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
eigerx committed Mar 13, 2024
1 parent 3a97ffd commit 89906b7
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions tests/test_cliCmdReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def tearDown(self) -> None:

def test_report(self):
"""Test for making a report on the produced and missing expected
datasets in a quantum graph. in a graph.
datasets in a quantum graph.
"""
metadata = {"output_run": "run"}
butler, qgraph = makeSimpleQGraph(
Expand All @@ -74,7 +74,6 @@ def test_report(self):
["report", self.root, graph_uri, "--full-output-filename", test_filename, "--no-logs"],
input="no",
)

# Check that we can read from the command line
self.assertEqual(result.exit_code, 0, clickResultMsg(result))

Expand All @@ -84,6 +83,23 @@ def test_report(self):
self.assertIsNotNone(report_output_dict["task0"])
self.assertIsNotNone(report_output_dict["task0"]["failed_quanta"])

result_hr = self.runner.invoke(
pipetask_cli,
["report", self.root, graph_uri, "--no-logs"],
input="no",
)

# Check that we can read from the command line
self.assertEqual(result_hr.exit_code, 0, clickResultMsg(result_hr))

# Check that we get string output
self.assertIsInstance(result_hr.stdout, str)

# Check that task0 and the failed quanta for task0 exist in the string
self.assertIn("task0", result_hr.stdout)
self.assertIn("Failed Quanta", result_hr.stdout)
self.assertIn("{'data_id': {'instrument': 'INSTR', 'detector': 0}}", result_hr.stdout)


if __name__ == "__main__":
unittest.main()

0 comments on commit 89906b7

Please sign in to comment.