@@ -25,7 +25,8 @@ def _get_target_class():
2525 def _make_one (self , * args , ** kw ):
2626 return self ._get_target_class ()(* args , ** kw )
2727
28- def test_constructor (self ):
28+ def test_constructor_defaults (self ):
29+ from google .cloud ._http import ClientInfo
2930 from google .cloud .translate_v2 ._http import Connection
3031 from google .cloud .translate_v2 .client import ENGLISH_ISO_639
3132
@@ -35,17 +36,23 @@ def test_constructor(self):
3536 self .assertIsNone (client ._connection .credentials )
3637 self .assertIs (client ._connection .http , http )
3738 self .assertEqual (client .target_language , ENGLISH_ISO_639 )
39+ self .assertIsInstance (client ._connection ._client_info , ClientInfo )
3840
39- def test_constructor_non_default (self ):
41+ def test_constructor_explicit (self ):
42+ from google .cloud ._http import ClientInfo
4043 from google .cloud .translate_v2 ._http import Connection
4144
4245 http = object ()
4346 target = "es"
44- client = self ._make_one (target_language = target , _http = http )
47+ client_info = ClientInfo ()
48+ client = self ._make_one (
49+ target_language = target , _http = http , client_info = client_info
50+ )
4551 self .assertIsInstance (client ._connection , Connection )
4652 self .assertIsNone (client ._connection .credentials )
4753 self .assertIs (client ._connection .http , http )
4854 self .assertEqual (client .target_language , target )
55+ self .assertIs (client ._connection ._client_info , client_info )
4956
5057 def test_get_languages (self ):
5158 from google .cloud .translate_v2 .client import ENGLISH_ISO_639
0 commit comments