Skip to content

Commit

Permalink
Corrections and feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
daspecster committed Dec 7, 2016
1 parent 40571c2 commit fc57af8
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions system_tests/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

from system_test_utils import unique_resource_id
from retry import RetryErrors
import six


_SYS_TESTS_DIR = os.path.abspath(os.path.dirname(__file__))
Expand Down Expand Up @@ -60,10 +61,10 @@ def _assert_coordinate(self, coordinate):
if coordinate is None:
return
self.assertIsInstance(coordinate, (int, float))
self.assertGreater(abs(coordinate), 0.0)
self.assertNotEqual(coordinate, 0.0)


class TestVisionClientLogo(BaseVisionTestCase):
class TestVisionClientLogo(unittest.TestCase):
def setUp(self):
self.to_delete_by_case = []

Expand Down Expand Up @@ -221,6 +222,10 @@ def test_detect_faces_filename(self):


class TestVisionClientLabel(BaseVisionTestCase):
DESCRIPTIONS = ['car', 'vehicle', 'land vehicle', 'automotive design',

This comment has been minimized.

Copy link
@dhermes

dhermes Dec 7, 2016

Contributor

Make a tuple so it is immutable? Also since it's so long, why not instead:

DESCRIPTIONS = (
    'car',
    'vehicle',
    ...,  # DAT TRAILING COMMA
)
'wheel', 'automobile make', 'luxury vehicle',
'sports car', 'performance car', 'automotive exterior']

def setUp(self):
self.to_delete_by_case = []

Expand All @@ -229,12 +234,10 @@ def tearDown(self):
value.delete()

def _assert_label(self, label):
descriptions = ['car', 'vehicle', 'land vehicle', 'automotive design',
'wheel', 'automobile make', 'luxury vehicle',
'sports car', 'performance car', 'automotive exterior']

self.assertIsInstance(label, EntityAnnotation)
self.assertIn(label.description, descriptions)
self.assertIsInstance(label.mid, unicode)
self.assertIn(label.description, self.DESCRIPTIONS)
self.assertIsInstance(label.mid, six.text_type)
self.assertGreater(label.score, 0.0)

def test_detect_labels_content(self):
Expand Down

0 comments on commit fc57af8

Please sign in to comment.