Unverified Commit 55741f95 authored by Dorian Johnson's avatar Dorian Johnson Committed by GitHub

tests: add mock for bigquery auth (#313)

parent 8075a6c7
...@@ -137,6 +137,8 @@ class MockBigQueryClient(): ...@@ -137,6 +137,8 @@ class MockBigQueryClient():
return self.tables_method return self.tables_method
# Patch fallback auth method to avoid actually calling google API
@patch('google.auth.default', lambda scopes: ['dummy', 'dummy'])
class TestBigQueryMetadataExtractor(unittest.TestCase): class TestBigQueryMetadataExtractor(unittest.TestCase):
def setUp(self): def setUp(self):
# type: () -> None # type: () -> None
......
...@@ -189,6 +189,8 @@ class MockLoggingClient(): ...@@ -189,6 +189,8 @@ class MockLoggingClient():
return self.b return self.b
# Patch fallback auth method to avoid actually calling google API
@patch('google.auth.default', lambda scopes: ['dummy', 'dummy'])
class TestBigqueryUsageExtractor(unittest.TestCase): class TestBigqueryUsageExtractor(unittest.TestCase):
@patch('databuilder.extractor.base_bigquery_extractor.build') @patch('databuilder.extractor.base_bigquery_extractor.build')
......
...@@ -83,6 +83,8 @@ class MockBigQueryClient(): ...@@ -83,6 +83,8 @@ class MockBigQueryClient():
return self.jobs_query return self.jobs_query
# Patch fallback auth method to avoid actually calling google API
@patch('google.auth.default', lambda scopes: ['dummy', 'dummy'])
class TestBigQueryWatermarkExtractor(unittest.TestCase): class TestBigQueryWatermarkExtractor(unittest.TestCase):
def setUp(self): def setUp(self):
# type: () -> None # type: () -> None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment