|
19 | 19 |
|
20 | 20 |
|
21 | 21 | class TestExportTableToGCS(CloudBaseTest): |
| 22 | + dataset_id = 'test_dataset' |
| 23 | + table_id = 'test_table' |
22 | 24 |
|
23 | 25 | def test_export_table_csv(self): |
| 26 | + cloud_storage_output_uri = \ |
| 27 | + 'gs://{}/output.csv'.format(self.bucket_name) |
24 | 28 | main( |
25 | | - self.constants['cloudStorageOutputURI'], |
26 | | - self.constants['projectId'], |
27 | | - self.constants['datasetId'], |
28 | | - self.constants['newTableId'], |
29 | | - 5, |
30 | | - 1, |
| 29 | + cloud_storage_output_uri, |
| 30 | + self.project_id, |
| 31 | + self.dataset_id, |
| 32 | + self.table_id, |
| 33 | + num_retries=5, |
| 34 | + interval=1, |
31 | 35 | export_format="CSV") |
32 | 36 |
|
33 | 37 | def test_export_table_json(self): |
| 38 | + cloud_storage_output_uri = \ |
| 39 | + 'gs://{}/output.json'.format(self.bucket_name) |
34 | 40 | main( |
35 | | - self.constants['cloudStorageOutputURI'], |
36 | | - self.constants['projectId'], |
37 | | - self.constants['datasetId'], |
38 | | - self.constants['newTableId'], |
39 | | - 5, |
40 | | - 1, |
| 41 | + cloud_storage_output_uri, |
| 42 | + self.project_id, |
| 43 | + self.dataset_id, |
| 44 | + self.table_id, |
| 45 | + num_retries=5, |
| 46 | + interval=1, |
41 | 47 | export_format="NEWLINE_DELIMITED_JSON") |
42 | 48 |
|
43 | 49 | def test_export_table_avro(self): |
| 50 | + cloud_storage_output_uri = \ |
| 51 | + 'gs://{}/output.avro'.format(self.bucket_name) |
44 | 52 | main( |
45 | | - self.constants['cloudStorageOutputURI'], |
46 | | - self.constants['projectId'], |
47 | | - self.constants['datasetId'], |
48 | | - self.constants['newTableId'], |
49 | | - 5, |
50 | | - 1, |
| 53 | + cloud_storage_output_uri, |
| 54 | + self.project_id, |
| 55 | + self.dataset_id, |
| 56 | + self.table_id, |
| 57 | + num_retries=5, |
| 58 | + interval=1, |
51 | 59 | export_format="AVRO") |
0 commit comments