コード例 #1
0
    def test_insert_accuracy_report_fail_invalid_date(self):
        report = {
            "type": "accuracy",
            "module_name": "chatterbox",
            "metric_name": "quick_search",
            "ts": "-0",
            "reference_id": '1',
            "reference_table": 'smsoutbox',
            "submetrics": [],
            "report_message": "Report description for test No. 4"
        }

        status = pms.insert_accuracy_report(report)
        self.assertFalse(status)
コード例 #2
0
    def test_insert_accuracy_report_success_with_sub_metrics(self):
        report = {
            "type": "accuracy",
            "module_name": "chatterbox",
            "metric_name": "quick_search",
            "ts": "2019-09-09 09:09:00",
            "reference_id": '1',
            "reference_table": 'smsoutbox',
            "submetrics": ['test1'],
            "report_message": "Report description for test No. 4"
        }

        status = pms.insert_accuracy_report(report)
        self.assertTrue(status)
コード例 #3
0
    def test_insert_accuracy_report_success_with_existing_metric(self):
        report = {
            "metric_name":
            "quick_search",
            "submetrics": [],
            "reference_id":
            '1',
            "reference_table":
            'smsoutbox',
            "ts":
            "2019-09-09 09:09:00",
            "report_message":
            "Report description for test No. 4" +
            str(random.randint(1, 21) * 5)
        }

        status = pms.insert_accuracy_report(report)
        self.assertTrue(status['status'])
コード例 #4
0
    def test_insert_accuracy_report_fail_invalid_all_fields(self):
        report = {
            "type":
            "accuracy",
            "module_name":
            "hg",
            "metric_name":
            "sdadsadsa",
            "ts":
            "09-09 :09:00",
            "reference_id":
            '1',
            "reference_table":
            'smsoutbox',
            "submetrics": [],
            "report_message":
            "Report description for test No. 4" +
            str(random.randint(1, 21) * 9999999999999999)
        }

        status = pms.insert_accuracy_report(report)
        self.assertFalse(status)