Beispiel #1
0
    def test_s3_store_on_failure(self):
        u = IdGapCheck({"table": "test_id_gap", "schema": "test", "column": "id", "threshold": "3", "config": self.config()})
        u.run()

        uri = u.failed_row_s3_uri
        s = requests.get(uri).content
        c = pd.read_csv(io.StringIO(s.decode('utf-8')))

        self.assertEquals(u.failed_rows.iloc[0].gap_start, c.iloc[0].gap_start)
        self.assertEquals(u.failed_rows.iloc[0].gap_end, c.iloc[0].gap_end)
    def test_id_gap_success(self, type):
        u = IdGapCheck({
            "table": "test_id_gap",
            "schema": "test",
            "column": "id",
            "threshold": "30",
            "config": self.config(type)
        })
        u.run()

        self.assertEqual(len(u.failed_rows), 0)
        self.assertFalse(u.failed)
    def test_id_gap_failure(self, type):
        u = IdGapCheck({
            "table": "test_id_gap",
            "schema": "test",
            "column": "id",
            "threshold": "3",
            "config": self.config(type)
        })
        u.run()

        self.assertEqual(len(u.failed_rows), 1)
        self.assertTrue(u.failed)
        self.assertEqual(u.failed_rows.iloc[0].gap_start, 1)
        self.assertEqual(u.failed_rows.iloc[0].gap_end, 5)
Beispiel #4
0
 def test_s3_nonstore_on_success(self):
     u = IdGapCheck({"table": "test_id_gap", "schema": "test", "column": "id", "threshold": "30", "config": self.config()})
     u.run()
     self.assertFalse(hasattr(u, 'failed_row_s3_uri'))