@@ -43,7 +43,7 @@ class TestClient(unittest.TestCase):
4343
4444 @staticmethod
4545 def _get_target_class ():
46- from google .cloud .logging_v2 . client import Client
46+ from google .cloud .logging import Client
4747
4848 return Client
4949
@@ -238,7 +238,7 @@ def make_api(client_obj):
238238 self .assertIs (again , api )
239239
240240 def test_logger (self ):
241- from google .cloud .logging_v2 . logger import Logger
241+ from google .cloud .logging import Logger
242242
243243 creds = _make_credentials ()
244244 client = self ._make_one (project = self .PROJECT , credentials = creds )
@@ -249,7 +249,7 @@ def test_logger(self):
249249 self .assertEqual (logger .project , self .PROJECT )
250250
251251 def test_list_entries_defaults (self ):
252- from google .cloud .logging_v2 . entries import TextEntry
252+ from google .cloud .logging import TextEntry
253253
254254 IID = "IID"
255255 TEXT = "TEXT"
@@ -308,10 +308,10 @@ def test_list_entries_defaults(self):
308308 self .assertLess (yesterday - timestamp , timedelta (minutes = 1 ))
309309
310310 def test_list_entries_explicit (self ):
311- from google .cloud .logging_v2 import DESCENDING
312- from google .cloud .logging_v2 . entries import ProtobufEntry
313- from google .cloud .logging_v2 . entries import StructEntry
314- from google .cloud .logging_v2 . logger import Logger
311+ from google .cloud .logging import DESCENDING
312+ from google .cloud .logging import ProtobufEntry
313+ from google .cloud .logging import StructEntry
314+ from google .cloud .logging import Logger
315315
316316 PROJECT1 = "PROJECT1"
317317 PROJECT2 = "PROJECT2"
@@ -404,10 +404,10 @@ def test_list_entries_explicit(self):
404404 self .assertLess (yesterday - timestamp , timedelta (minutes = 1 ))
405405
406406 def test_list_entries_explicit_timestamp (self ):
407- from google .cloud .logging_v2 import DESCENDING
408- from google .cloud .logging_v2 . entries import ProtobufEntry
409- from google .cloud .logging_v2 . entries import StructEntry
410- from google .cloud .logging_v2 . logger import Logger
407+ from google .cloud .logging import DESCENDING
408+ from google .cloud .logging import ProtobufEntry
409+ from google .cloud .logging import StructEntry
410+ from google .cloud .logging import Logger
411411
412412 PROJECT1 = "PROJECT1"
413413 PROJECT2 = "PROJECT2"
@@ -492,7 +492,7 @@ def test_list_entries_explicit_timestamp(self):
492492 )
493493
494494 def test_sink_defaults (self ):
495- from google .cloud .logging_v2 . sink import Sink
495+ from google .cloud .logging import Sink
496496
497497 creds = _make_credentials ()
498498 client = self ._make_one (project = self .PROJECT , credentials = creds )
@@ -505,7 +505,7 @@ def test_sink_defaults(self):
505505 self .assertEqual (sink .parent , self .PROJECT_PATH )
506506
507507 def test_sink_explicit (self ):
508- from google .cloud .logging_v2 . sink import Sink
508+ from google .cloud .logging import Sink
509509
510510 creds = _make_credentials ()
511511 client = self ._make_one (project = self .PROJECT , credentials = creds )
@@ -520,7 +520,7 @@ def test_sink_explicit(self):
520520 self .assertEqual (sink .parent , self .PROJECT_PATH )
521521
522522 def test_list_sinks_no_paging (self ):
523- from google .cloud .logging_v2 . sink import Sink
523+ from google .cloud .logging import Sink
524524
525525 PROJECT = "PROJECT"
526526 TOKEN = "TOKEN"
@@ -559,7 +559,7 @@ def test_list_sinks_no_paging(self):
559559 )
560560
561561 def test_list_sinks_with_paging (self ):
562- from google .cloud .logging_v2 . sink import Sink
562+ from google .cloud .logging import Sink
563563
564564 PROJECT = "PROJECT"
565565 SINK_NAME = "sink_name"
@@ -603,7 +603,7 @@ def test_list_sinks_with_paging(self):
603603 )
604604
605605 def test_metric_defaults (self ):
606- from google .cloud .logging_v2 . metric import Metric
606+ from google .cloud .logging import Metric
607607
608608 creds = _make_credentials ()
609609
@@ -617,7 +617,7 @@ def test_metric_defaults(self):
617617 self .assertEqual (metric .project , self .PROJECT )
618618
619619 def test_metric_explicit (self ):
620- from google .cloud .logging_v2 . metric import Metric
620+ from google .cloud .logging import Metric
621621
622622 creds = _make_credentials ()
623623
@@ -633,7 +633,7 @@ def test_metric_explicit(self):
633633 self .assertEqual (metric .project , self .PROJECT )
634634
635635 def test_list_metrics_no_paging (self ):
636- from google .cloud .logging_v2 . metric import Metric
636+ from google .cloud .logging import Metric
637637
638638 metrics = [
639639 {
@@ -669,7 +669,7 @@ def test_list_metrics_no_paging(self):
669669 )
670670
671671 def test_list_metrics_with_paging (self ):
672- from google .cloud .logging_v2 . metric import Metric
672+ from google .cloud .logging import Metric
673673
674674 token = "TOKEN"
675675 next_token = "T00KEN"
@@ -719,7 +719,7 @@ def test_get_default_handler_app_engine(self):
719719 import os
720720 from google .cloud ._testing import _Monkey
721721 from google .cloud .logging_v2 .client import _APPENGINE_FLEXIBLE_ENV_VM
722- from google .cloud .logging_v2 .handlers import AppEngineHandler
722+ from google .cloud .logging .handlers import AppEngineHandler
723723
724724 credentials = _make_credentials ()
725725 client = self ._make_one (
@@ -734,7 +734,7 @@ def test_get_default_handler_app_engine(self):
734734 self .assertIsInstance (handler , AppEngineHandler )
735735
736736 def test_get_default_handler_container_engine (self ):
737- from google .cloud .logging_v2 .handlers import ContainerEngineHandler
737+ from google .cloud .logging .handlers import ContainerEngineHandler
738738
739739 credentials = _make_credentials ()
740740 client = self ._make_one (
@@ -753,8 +753,8 @@ def test_get_default_handler_container_engine(self):
753753
754754 def test_get_default_handler_general (self ):
755755 import io
756- from google .cloud .logging_v2 .handlers import CloudLoggingHandler
757- from google .cloud .logging_v2 . resource import Resource
756+ from google .cloud .logging .handlers import CloudLoggingHandler
757+ from google .cloud .logging import Resource
758758
759759 name = "test-logger"
760760 resource = Resource ("resource_type" , {"resource_label" : "value" })
@@ -778,7 +778,7 @@ def test_get_default_handler_general(self):
778778 self .assertEqual (handler .labels , labels )
779779
780780 def test_setup_logging (self ):
781- from google .cloud .logging_v2 .handlers import CloudLoggingHandler
781+ from google .cloud .logging .handlers import CloudLoggingHandler
782782
783783 credentials = _make_credentials ()
784784 client = self ._make_one (
@@ -804,8 +804,8 @@ def test_setup_logging(self):
804804
805805 def test_setup_logging_w_extra_kwargs (self ):
806806 import io
807- from google .cloud .logging_v2 .handlers import CloudLoggingHandler
808- from google .cloud .logging_v2 . resource import Resource
807+ from google .cloud .logging .handlers import CloudLoggingHandler
808+ from google .cloud .logging import Resource
809809
810810 name = "test-logger"
811811 resource = Resource ("resource_type" , {"resource_label" : "value" })
0 commit comments