def test_get_logs(self): tcr_log = LinkReference.get_from(self.case_run_1)[0] logs = testcaserun.get_logs(None, self.case_run_1.pk) self.assertIsInstance(logs, list) self.assertEqual(len(logs), 1) self.assertEqual(logs[0]['id'], tcr_log.pk) self.assertEqual(logs[0]['name'], "Test logs") self.assertEqual(logs[0]['url'], "http://www.google.com")
def get_logs(request, case_run_id): """ Description: Get log links to TestCaseRun Params: $case_run_id - Integer: """ test_case_run = TestCaseRun.objects.get(pk=case_run_id) links = LinkReference.get_from(test_case_run) s = XMLRPCSerializer(links) return s.serialize_queryset()
def get_logs(request, case_run_id): """Get log links to TestCaseRun :param int case_run_id: case run ID. :return: list of mappings of found logs :class:`LinkReference`. :rtype: list[dict] """ test_case_run = TestCaseRun.objects.get(pk=case_run_id) links = LinkReference.get_from(test_case_run) s = XMLRPCSerializer(links) return s.serialize_queryset()
def get_logs(request, case_run_id): """ Description: Get log links to TestCaseRun Params: $case_run_id - Integer: """ try: test_case_run = TestCaseRun.objects.get(pk=case_run_id) except ObjectDoesNotExist: raise links = LinkReference.get_from(test_case_run) s = XMLRPCSerializer(links) return s.serialize_queryset()
""" try: test_case_run = TestCaseRun.objects.get(pk=case_run_id) except ObjectDoesNotExist, error: raise try: LinkReference.unlink(link_id) except: raise return def get_logs(request, case_run_id): """ Description: Get log links to TestCaseRun Params: $case_run_id - Integer: """ try: test_case_run = TestCaseRun.objects.get(pk=case_run_id) except ObjectDoesNotExist, error: raise links = LinkReference.get_from(test_case_run) s = XMLRPCSerializer(links) return s.serialize_queryset()