Exemplo n.º 1
0
    def test_insert_timeliness_report_fail_empty_fields(self):
        report = {
            "type": "timeliness",
            "module_name": "",
            "metric_name": "",
            "reference_id": '',
            "reference_table": '',
            "submetrics": [],
            "ts": "",
            "execution_time": ""
        }

        status = pms.insert_timeliness_report(report)
        self.assertFalse(status)
Exemplo n.º 2
0
    def test_insert_timeliness_report_success_with_sub_metrics(self):
        report = {
            "type": "timeliness",
            "module_name": "chatterbox",
            "metric_name": "quick_search",
            "reference_id": '1',
            "reference_table": 'smsoutbox',
            "submetrics": ['test1'],
            "ts": "2019-09-09 09:09:00",
            "execution_time": "100"
        }

        status = pms.insert_timeliness_report(report)
        self.assertTrue(status)
Exemplo n.º 3
0
    def test_insert_timeliness_report_fail_invalid_metric(self):
        report = {
            "type": "timeliness",
            "module_name": "chatterbox",
            "metric_name": "quick_seaasdasdasdasdrch",
            "reference_id": '1',
            "reference_table": 'smsoutbox',
            "submetrics": [],
            "ts": "2019-09-09 09:09:00",
            "execution_time": "100"
        }

        status = pms.insert_timeliness_report(report)
        self.assertFalse(status)
Exemplo n.º 4
0
    def test_insert_timeliness_report_success_utf8_character(self):
        report = {
            "type": "timeliness",
            "module_name": "chatterbox",
            "metric_name": "quick_search",
            "reference_id": '1',
            "reference_table": 'smsoutbox',
            "submetrics": [],
            "ts": "2019-09-09 09:09:00",
            "execution_time": str(random.randint(1, 21) * 25)
        }

        status = pms.insert_timeliness_report(report)
        self.assertTrue(status)
Exemplo n.º 5
0
    def test_insert_timeliness_report_fail_invalid_execution_time_length(self):
        report = {
            "type":
            "timeliness",
            "module_name":
            "chatterbox",
            "metric_name":
            "quick_search",
            "reference_id":
            '1',
            "reference_table":
            'smsoutbox',
            "submetrics": [],
            "ts":
            "2019-09-09 09:09:00",
            "execution_time":
            str(random.randint(1, 21) * 2599999999999999999999999999)
        }

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