def setUp(self): """ Set up fake results from 3 node. """ service = Service(name="$$test_service_a$$", ip=TEST_IP) service_result = Result(service=service, status=TEST_STATUS) result = [service_result, service_result] node_result_a = NodeResult("$$test_group_a$$", "$$test_ip_a$$", result) node_result_b = NodeResult("$$test_group_b$$", "$$test_ip_b$$", result) self.node_results = [node_result_a, node_result_a, node_result_b] self.formated_result = FormatedResult()
class FormatedResultTest(TestCase): """ The test cases to test the output of Sedna result """ def setUp(self): """ Set up fake results from 3 node. """ service = Service(name="$$test_service_a$$", ip=TEST_IP) service_result = Result(service=service, status=TEST_STATUS) result = [service_result, service_result] node_result_a = NodeResult("$$test_group_a$$", "$$test_ip_a$$", result) node_result_b = NodeResult("$$test_group_b$$", "$$test_ip_b$$", result) self.node_results = [node_result_a, node_result_a, node_result_b] self.formated_result = FormatedResult() def test_format_output_log(self): """ The test case to test the log to display results from all nodes. The result of the test case should be check in sedna/tests/log/sedna.log :return: """ self.formated_result.format_output_log(self.node_results)