コード例 #1
0
ファイル: test_s3.py プロジェクト: chall8908/data_check
    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)
コード例 #2
0
    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)
コード例 #3
0
    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)
コード例 #4
0
ファイル: test_s3.py プロジェクト: chall8908/data_check
 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'))