Skip to content

Commit

Permalink
Update test_detail.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ZihengSun committed May 21, 2023
1 parent 8211ed7 commit f7204da
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions test/test_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,26 @@
logger = get_logger(__name__)



class TestDetail(unittest.TestCase):


def test_detail_process(self, capsys):
output_capture = StringIO()
detail_process("not_existing_id")
captured = capsys.readouterr()
output = output_capture.getvalue()
self.assertIn("No host found with id: not_existing_id", output)

@unittest.skip("")
def test_detail_workflow(self):
stdout_capture = StringIO()
detail_workflow("not_existing_id")
output = stdout_capture.getvalue()
self.assertIn("No process found with id: not_existing_id", output)

@unittest.skip("")
def test_detail_host(self):
stdout_capture = StringIO()
detail_host("not_existing_id")
output = stdout_capture.getvalue()
self.assertIn("No workflow found with id: not_existing_id", output)
def test_detail_process(capfd):
detail_process("not_existing_id")
output, err = capfd.readouterr()
logger.info("stdout_output"+output)
logger.info("stderr_output"+err)
assert "No process found with id: not_existing_id" in output


def test_detail_workflow(capfd):
detail_workflow("not_existing_id")
output, err = capfd.readouterr()
logger.info("stdout_output"+output)
logger.info("stderr_output"+err)
assert "No workflow found with id: not_existing_id" in output


def test_detail_host(capfd):
detail_host("not_existing_id")
output, err = capfd.readouterr()
logger.info("stdout_output"+output)
logger.info("stderr_output"+err)
assert "No host found with id: not_existing_id" in output

0 comments on commit f7204da

Please sign in to comment.