示例#1
0
 def test_get_source_uris_with_pattern(self):
     worker = workers.StorageToBQImporter(
         {'source_uris': [
             'gs://bucket/subdir/*.csv',
         ]}, 1, 1)
     source_uris = worker._get_source_uris()
     self.assertEqual(len(source_uris), 2)
     self.assertEqual(source_uris[0], 'gs://bucket/subdir/input.csv')
     self.assertEqual(source_uris[1], 'gs://bucket/subdir/data.csv')
示例#2
0
 def test_get_source_uris_succeeds(self):
     worker = workers.StorageToBQImporter(
         {
             'source_uris': [
                 'gs://bucket/data.csv',
                 'gs://bucket/subdir/data.csv',
             ]
         }, 1, 1)
     worker._get_source_uris()
     self.assertEqual(len(worker._source_uris), 2)
     self.assertEqual(worker._source_uris[0], 'gs://bucket/data.csv')
     self.assertEqual(worker._source_uris[1], 'gs://bucket/subdir/data.csv')