@@ -33,7 +33,8 @@ def _get_target_class():
3333 def _make_one (self , * args , ** kw ):
3434 return self ._get_target_class ()(* args , ** kw )
3535
36- def test_constructor (self ):
36+ def test_ctor_wo_client_info (self ):
37+ from google .cloud ._http import ClientInfo
3738 from google .cloud .resource_manager ._http import Connection
3839
3940 http = object ()
@@ -42,6 +43,22 @@ def test_constructor(self):
4243 self .assertIsInstance (client ._connection , Connection )
4344 self .assertIs (client ._credentials , credentials )
4445 self .assertIs (client ._http_internal , http )
46+ self .assertIsInstance (client ._connection ._client_info , ClientInfo )
47+
48+ def test_ctor_w_client_info (self ):
49+ from google .cloud ._http import ClientInfo
50+ from google .cloud .resource_manager ._http import Connection
51+
52+ http = object ()
53+ client_info = ClientInfo ()
54+ credentials = _make_credentials ()
55+ client = self ._make_one (
56+ credentials = credentials , _http = http , client_info = client_info
57+ )
58+ self .assertIsInstance (client ._connection , Connection )
59+ self .assertIs (client ._credentials , credentials )
60+ self .assertIs (client ._http_internal , http )
61+ self .assertIs (client ._connection ._client_info , client_info )
4562
4663 def test_new_project_factory (self ):
4764 from google .cloud .resource_manager .project import Project
0 commit comments