示例#1
0
 def test_create_table(self):
     with AdapterMysql(DB_CONFIG) as adapter_mysql:
         table = adapter_mysql.get_result_table(self.query_table_read)
         with AdapterBigquery(SERVICE_ACC) as adapter_bq:
             adapter_bq.create_table(table, self.adress_table_write)
             table = adapter_bq.get_result_table(self.query_table_write)
             self.assertEqual(table.schema, RESULT_TABLE.schema)
             self.assertEqual(list(table.row_iter), RESULT_TABLE.row_iter)
 def test_create_table(self):
     with AdapterBigquery(SERVICE_ACC) as adapter:
         table = Table(RESULT_TABLE.schema,
                       (row for row in RESULT_TABLE.row_iter))
         adapter.create_table(table, self.adress_table_write)
         table = adapter.get_result_table(self.query_table_write)
         self.assertEqual(table.schema, RESULT_TABLE.schema)
         self.assertEqual(list(table.row_iter), RESULT_TABLE.row_iter)
示例#3
0
 def test_create_table(self):
     with AdapterBigquery(SERVICE_ACC) as adapter_bq:
         table = adapter_bq.get_result_table(self.query_table_read)
         with AdapterCsv() as adapter_csv:
             adapter_csv.create_table(table, CSV_TEMP_PATH)
             table = adapter_csv.get_result_table(CSV_TEMP_PATH)
             self.assertEqual(table.schema, RESULT_TABLE.schema)
             self.assertEqual(list(table.row_iter), RESULT_TABLE.row_iter)
示例#4
0
 def tearDownClass(cls):
     with AdapterBigquery(SERVICE_ACC) as adapter:
         adapter.delete_table(cls.adress_table_write)
 def test_get_result_table(self):
     with AdapterBigquery(SERVICE_ACC) as adapter:
         table = adapter.get_result_table(self.query_table_read)
         self.assertEqual(table.schema, RESULT_TABLE.schema)
         self.assertEqual(list(table.row_iter), RESULT_TABLE.row_iter)