Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bigquery/unit_tests/test__helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ def test_w_non_bytes(self):

def test_w_bytes(self):
import base64

source = b'source'
expected = base64.encodestring(source)
self.assertEqual(self._call_fut(source), expected)
Expand Down
1 change: 1 addition & 0 deletions bigquery/unit_tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,7 @@ def test_upload_from_file_multipart_w_400(self):
from google.cloud._testing import _NamedTemporaryFile
from google.cloud._helpers import UTC
from google.cloud.exceptions import BadRequest

WHEN_TS = 1437767599.006
WHEN = datetime.datetime.utcfromtimestamp(WHEN_TS).replace(
tzinfo=UTC)
Expand Down
1 change: 1 addition & 0 deletions core/unit_tests/test__helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ class Test__name_from_project_path(unittest.TestCase):

def _call_fut(self, path, project, template):
from google.cloud._helpers import _name_from_project_path

return _name_from_project_path(path, project, template)

def test_w_invalid_path_length(self):
Expand Down
2 changes: 2 additions & 0 deletions error_reporting/unit_tests/test__gax.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Test_make_report_error_api(unittest.TestCase):

def test_make_report_error_api(self):
from google.cloud.error_reporting._gax import make_report_error_api

client = mock.Mock()
client.project = mock.Mock()
report_error_client = make_report_error_api(client)
Expand All @@ -33,6 +34,7 @@ class Test_ErrorReportingGaxApi(unittest.TestCase):

def _call_fut(self, gax_api, project):
from google.cloud.error_reporting._gax import _ErrorReportingGaxApi

return _ErrorReportingGaxApi(gax_api, project)

def test_constructor(self):
Expand Down
2 changes: 2 additions & 0 deletions error_reporting/unit_tests/test__logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

def _make_credentials():
import google.auth.credentials

return mock.Mock(spec=google.auth.credentials.Credentials)


Expand All @@ -31,6 +32,7 @@ class Test_ErrorReportingLoggingAPI(unittest.TestCase):
def _call_fut(self, project, credentials):
from google.cloud.error_reporting._logging import (
_ErrorReportingLoggingAPI)

return _ErrorReportingLoggingAPI(project, credentials)

def test_constructor(self):
Expand Down
3 changes: 1 addition & 2 deletions error_reporting/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ def test_report_exception_wo_gax(self):

@mock.patch('google.cloud.error_reporting.client.make_report_error_api')
def test_report_exception_with_service_version_in_constructor(
self,
make_client):
self, make_client):
CREDENTIALS = _make_credentials()
SERVICE = "notdefault"
VERSION = "notdefaultversion"
Expand Down
2 changes: 2 additions & 0 deletions logging/unit_tests/handlers/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class TestCloudLoggingHandler(unittest.TestCase):
@staticmethod
def _get_target_class():
from google.cloud.logging.handlers.handlers import CloudLoggingHandler

return CloudLoggingHandler

def _make_one(self, *args, **kw):
Expand All @@ -49,6 +50,7 @@ class TestSetupLogging(unittest.TestCase):

def _call_fut(self, handler, excludes=None):
from google.cloud.logging.handlers.handlers import setup_logging

if excludes:
return setup_logging(handler, excluded_loggers=excludes)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class TestBackgroundThreadHandler(unittest.TestCase):
def _get_target_class():
from google.cloud.logging.handlers.transports import (
BackgroundThreadTransport)

return BackgroundThreadTransport

def _make_one(self, *args, **kw):
Expand Down Expand Up @@ -62,6 +63,7 @@ class TestWorker(unittest.TestCase):
@staticmethod
def _get_target_class():
from google.cloud.logging.handlers.transports import background_thread

return background_thread._Worker

def _make_one(self, *args, **kw):
Expand Down
1 change: 1 addition & 0 deletions logging/unit_tests/handlers/transports/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class TestBaseHandler(unittest.TestCase):
@staticmethod
def _get_target_class():
from google.cloud.logging.handlers.transports import Transport

return Transport

def _make_one(self, *args, **kw):
Expand Down
1 change: 1 addition & 0 deletions logging/unit_tests/handlers/transports/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class TestSyncHandler(unittest.TestCase):
@staticmethod
def _get_target_class():
from google.cloud.logging.handlers.transports import SyncTransport

return SyncTransport

def _make_one(self, *args, **kw):
Expand Down
1 change: 1 addition & 0 deletions logging/unit_tests/test__gax.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class Test_LoggingAPI(_Base, unittest.TestCase):
@staticmethod
def _get_target_class():
from google.cloud.logging._gax import _LoggingAPI

return _LoggingAPI

def test_ctor(self):
Expand Down
Loading