Skip to content

Commit

Permalink
Renaming some vision test fixture imports.
Browse files Browse the repository at this point in the history
Done mostly via:

$ git grep -l 'unit_tests.vision._fixtures' |
> xargs sed -i s/'unit_tests.vision._fixtures'/'unit_tests._fixtures'/g

Then fixed up some indents after the fact.
  • Loading branch information
dhermes committed Sep 26, 2016
1 parent a7036e2 commit 09e3e3f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
34 changes: 19 additions & 15 deletions vision/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_ctor(self):

def test_face_annotation(self):
from google.cloud.vision.feature import Feature, FeatureTypes
from unit_tests.vision._fixtures import FACE_DETECTION_RESPONSE
from unit_tests._fixtures import FACE_DETECTION_RESPONSE

RETURNED = FACE_DETECTION_RESPONSE
REQUEST = {
Expand Down Expand Up @@ -82,7 +82,7 @@ def test_image_with_client(self):

def test_face_detection_from_source(self):
from google.cloud.vision.face import Face
from unit_tests.vision._fixtures import FACE_DETECTION_RESPONSE
from unit_tests._fixtures import FACE_DETECTION_RESPONSE
RETURNED = FACE_DETECTION_RESPONSE
credentials = _Credentials()
client = self._makeOne(project=self.PROJECT, credentials=credentials)
Expand All @@ -99,7 +99,7 @@ def test_face_detection_from_source(self):

def test_face_detection_from_content(self):
from google.cloud.vision.face import Face
from unit_tests.vision._fixtures import FACE_DETECTION_RESPONSE
from unit_tests._fixtures import FACE_DETECTION_RESPONSE
RETURNED = FACE_DETECTION_RESPONSE
credentials = _Credentials()
client = self._makeOne(project=self.PROJECT, credentials=credentials)
Expand All @@ -116,8 +116,9 @@ def test_face_detection_from_content(self):

def test_label_detection_from_source(self):
from google.cloud.vision.entity import EntityAnnotation
from unit_tests.vision._fixtures import (LABEL_DETECTION_RESPONSE as
RETURNED)
from unit_tests._fixtures import (
LABEL_DETECTION_RESPONSE as RETURNED)

credentials = _Credentials()
client = self._makeOne(project=self.PROJECT, credentials=credentials)
client.connection = _Connection(RETURNED)
Expand All @@ -137,8 +138,9 @@ def test_label_detection_from_source(self):

def test_landmark_detection_from_source(self):
from google.cloud.vision.entity import EntityAnnotation
from unit_tests.vision._fixtures import (LANDMARK_DETECTION_RESPONSE as
RETURNED)
from unit_tests._fixtures import (
LANDMARK_DETECTION_RESPONSE as RETURNED)

credentials = _Credentials()
client = self._makeOne(project=self.PROJECT, credentials=credentials)
client.connection = _Connection(RETURNED)
Expand All @@ -158,8 +160,9 @@ def test_landmark_detection_from_source(self):

def test_landmark_detection_from_content(self):
from google.cloud.vision.entity import EntityAnnotation
from unit_tests.vision._fixtures import (LANDMARK_DETECTION_RESPONSE as
RETURNED)
from unit_tests._fixtures import (
LANDMARK_DETECTION_RESPONSE as RETURNED)

credentials = _Credentials()
client = self._makeOne(project=self.PROJECT, credentials=credentials)
client.connection = _Connection(RETURNED)
Expand All @@ -175,7 +178,7 @@ def test_landmark_detection_from_content(self):

def test_logo_detection_from_source(self):
from google.cloud.vision.entity import EntityAnnotation
from unit_tests.vision._fixtures import LOGO_DETECTION_RESPONSE
from unit_tests._fixtures import LOGO_DETECTION_RESPONSE
RETURNED = LOGO_DETECTION_RESPONSE
credentials = _Credentials()
client = self._makeOne(project=self.PROJECT, credentials=credentials)
Expand All @@ -192,7 +195,7 @@ def test_logo_detection_from_source(self):

def test_logo_detection_from_content(self):
from google.cloud.vision.entity import EntityAnnotation
from unit_tests.vision._fixtures import LOGO_DETECTION_RESPONSE
from unit_tests._fixtures import LOGO_DETECTION_RESPONSE
RETURNED = LOGO_DETECTION_RESPONSE
credentials = _Credentials()
client = self._makeOne(project=self.PROJECT, credentials=credentials)
Expand All @@ -209,8 +212,9 @@ def test_logo_detection_from_content(self):

def test_text_detection_from_source(self):
from google.cloud.vision.entity import EntityAnnotation
from unit_tests.vision._fixtures import (TEXT_DETECTION_RESPONSE as
RETURNED)
from unit_tests._fixtures import (
TEXT_DETECTION_RESPONSE as RETURNED)

credentials = _Credentials()
client = self._makeOne(project=self.PROJECT, credentials=credentials)
client.connection = _Connection(RETURNED)
Expand All @@ -230,7 +234,7 @@ def test_text_detection_from_source(self):

def test_safe_search_detection_from_source(self):
from google.cloud.vision.safe import SafeSearchAnnotation
from unit_tests.vision._fixtures import SAFE_SEARCH_DETECTION_RESPONSE
from unit_tests._fixtures import SAFE_SEARCH_DETECTION_RESPONSE

RETURNED = SAFE_SEARCH_DETECTION_RESPONSE
credentials = _Credentials()
Expand All @@ -250,7 +254,7 @@ def test_safe_search_detection_from_source(self):

def test_image_properties_detection_from_source(self):
from google.cloud.vision.color import ImagePropertiesAnnotation
from unit_tests.vision._fixtures import IMAGE_PROPERTIES_RESPONSE
from unit_tests._fixtures import IMAGE_PROPERTIES_RESPONSE

RETURNED = IMAGE_PROPERTIES_RESPONSE
credentials = _Credentials()
Expand Down
2 changes: 1 addition & 1 deletion vision/unit_tests/test_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _getTargetClass(self):
return EntityAnnotation

def test_logo_annotation(self):
from unit_tests.vision._fixtures import LOGO_DETECTION_RESPONSE
from unit_tests._fixtures import LOGO_DETECTION_RESPONSE

LOGO = LOGO_DETECTION_RESPONSE['responses'][0]['logoAnnotations'][0]
entity_class = self._getTargetClass()
Expand Down
2 changes: 1 addition & 1 deletion vision/unit_tests/test_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _getTargetClass(self):
return Face

def setUp(self):
from unit_tests.vision._fixtures import FACE_DETECTION_RESPONSE
from unit_tests._fixtures import FACE_DETECTION_RESPONSE
self.FACE_ANNOTATIONS = FACE_DETECTION_RESPONSE['responses'][0]
self.face_class = self._getTargetClass()
self.face = self.face_class.from_api_repr(
Expand Down

0 comments on commit 09e3e3f

Please sign in to comment.