Skip to content

Commit

Permalink
added shim tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sanche committed Dec 8, 2020
1 parent dc5d386 commit be7cefd
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion tests/unit/test_logging_shim.py
Expand Up @@ -17,7 +17,7 @@


class TestLoggingShim(unittest.TestCase):
def test_shim_matches_logging_v2(self):
def test_root_shim_matches_logging_v2(self):
from google.cloud import logging
from google.cloud import logging_v2

Expand All @@ -27,3 +27,36 @@ def test_shim_matches_logging_v2(self):
found = getattr(logging, name)
expected = getattr(logging_v2, name)
self.assertIs(found, expected)

def test_handler_shim_matches_logging_v2(self):
from google.cloud.logging import handlers
from google.cloud.logging_v2 import handlers as handler_2

self.assertEqual(handlers.__all__, handlersv2.__all__)

for name in handlers.__all__:
found = getattr(handlers, name)
expected = getattr(handlers_2, name)
self.assertIs(found, expected)

def test_middleware_shim_matches_logging_v2(self):
from google.cloud.logging.handlers import middleware
from google.cloud.logging_v2.handlers import middleware as middleware_2

self.assertEqual(middleware.__all__, middleware_2.__all__)

for name in middleware.__all__:
found = getattr(middleware, name)
expected = getattr(middleware_2, name)
self.assertIs(found, expected)

def test_transports_shim_matches_logging_v2(self):
from google.cloud.logging.handlers import transports
from google.cloud.logging_v2.handlers import transports as transports_2

self.assertEqual(middleware.__all__, transports_2.__all__)

for name in transports.__all__:
found = getattr(transports, name)
expected = getattr(transports_2, name)
self.assertIs(found, expected)

0 comments on commit be7cefd

Please sign in to comment.