@@ -27,10 +27,9 @@ def _makeOne(self, *args, **kw):
2727 def test_ctor (self ):
2828 from gcloud .language .connection import Connection
2929
30- project = 'PROJECT'
3130 creds = _Credentials ()
3231 http = object ()
33- client = self ._makeOne (project = project , credentials = creds , http = http )
32+ client = self ._makeOne (credentials = creds , http = http )
3433 self .assertIsInstance (client .connection , Connection )
3534 self .assertTrue (client .connection .credentials is creds )
3635 self .assertTrue (client .connection .http is http )
@@ -39,8 +38,7 @@ def test_document_from_text_factory(self):
3938 from gcloud .language .document import Document
4039
4140 creds = _Credentials ()
42- client = self ._makeOne (project = 'PROJECT' ,
43- credentials = creds , http = object ())
41+ client = self ._makeOne (credentials = creds , http = object ())
4442
4543 content = 'abc'
4644 language = 'es'
@@ -55,8 +53,7 @@ def test_document_from_text_factory(self):
5553
5654 def test_document_from_text_factory_failure (self ):
5755 creds = _Credentials ()
58- client = self ._makeOne (project = 'PROJECT' ,
59- credentials = creds , http = object ())
56+ client = self ._makeOne (credentials = creds , http = object ())
6057
6158 with self .assertRaises (TypeError ):
6259 client .document_from_text ('abc' , doc_type = 'foo' )
@@ -65,8 +62,7 @@ def test_document_from_html_factory(self):
6562 from gcloud .language .document import Document
6663
6764 creds = _Credentials ()
68- client = self ._makeOne (project = 'PROJECT' ,
69- credentials = creds , http = object ())
65+ client = self ._makeOne (credentials = creds , http = object ())
7066
7167 content = '<html>abc</html>'
7268 language = 'ja'
@@ -81,8 +77,7 @@ def test_document_from_html_factory(self):
8177
8278 def test_document_from_html_factory_failure (self ):
8379 creds = _Credentials ()
84- client = self ._makeOne (project = 'PROJECT' ,
85- credentials = creds , http = object ())
80+ client = self ._makeOne (credentials = creds , http = object ())
8681
8782 with self .assertRaises (TypeError ):
8883 client .document_from_html ('abc' , doc_type = 'foo' )
@@ -91,8 +86,7 @@ def test_document_from_url_factory(self):
9186 from gcloud .language .document import Document
9287
9388 creds = _Credentials ()
94- client = self ._makeOne (project = 'PROJECT' ,
95- credentials = creds , http = object ())
89+ client = self ._makeOne (credentials = creds , http = object ())
9690
9791 gcs_url = 'gs://my-text-bucket/sentiment-me.txt'
9892 document = client .document_from_url (gcs_url )
@@ -107,8 +101,7 @@ def test_document_from_url_factory_explicit(self):
107101 from gcloud .language .document import Encoding
108102
109103 creds = _Credentials ()
110- client = self ._makeOne (project = 'PROJECT' ,
111- credentials = creds , http = object ())
104+ client = self ._makeOne (credentials = creds , http = object ())
112105
113106 encoding = Encoding .UTF32
114107 gcs_url = 'gs://my-text-bucket/sentiment-me.txt'
@@ -121,23 +114,6 @@ def test_document_from_url_factory_explicit(self):
121114 self .assertEqual (document .doc_type , Document .HTML )
122115 self .assertEqual (document .encoding , encoding )
123116
124- def test_document_from_blob_factory (self ):
125- from gcloud .language .document import Document
126-
127- creds = _Credentials ()
128- client = self ._makeOne (project = 'PROJECT' ,
129- credentials = creds , http = object ())
130-
131- bucket_name = 'my-text-bucket'
132- blob_name = 'sentiment-me.txt'
133- gcs_url = 'gs://%s/%s' % (bucket_name , blob_name )
134- document = client .document_from_blob (bucket_name , blob_name )
135- self .assertIsInstance (document , Document )
136- self .assertIs (document .client , client )
137- self .assertIsNone (document .content )
138- self .assertEqual (document .gcs_url , gcs_url )
139- self .assertEqual (document .doc_type , Document .PLAIN_TEXT )
140-
141117
142118class _Credentials (object ):
143119
0 commit comments