Style fixes.

This commit is contained in:
Jake Moshenko 2015-08-24 11:59:46 -04:00
parent b998eca8e5
commit 3bfec1d7a9
2 changed files with 8 additions and 11 deletions

View file

@ -143,14 +143,11 @@ def build_index_specs():
IndexTestSpec(url_for('v1.get_image_json', image_id=FAKE_IMAGE_ID), IndexTestSpec(url_for('v1.get_image_json', image_id=FAKE_IMAGE_ID),
ORG_REPO, 403, 403, 404, 404), ORG_REPO, 403, 403, 404, 404),
IndexTestSpec(url_for('v1.get_image_ancestry', IndexTestSpec(url_for('v1.get_image_ancestry', image_id=FAKE_IMAGE_ID),
image_id=FAKE_IMAGE_ID),
PUBLIC_REPO, 404, 404, 404, 404), PUBLIC_REPO, 404, 404, 404, 404),
IndexTestSpec(url_for('v1.get_image_ancestry', IndexTestSpec(url_for('v1.get_image_ancestry', image_id=FAKE_IMAGE_ID),
image_id=FAKE_IMAGE_ID),
PRIVATE_REPO, 403, 403, 404, 404), PRIVATE_REPO, 403, 403, 404, 404),
IndexTestSpec(url_for('v1.get_image_ancestry', IndexTestSpec(url_for('v1.get_image_ancestry', image_id=FAKE_IMAGE_ID),
image_id=FAKE_IMAGE_ID),
ORG_REPO, 403, 403, 404, 404), ORG_REPO, 403, 403, 404, 404),
IndexTestSpec(url_for('v1.put_image_json', image_id=FAKE_IMAGE_ID), IndexTestSpec(url_for('v1.put_image_json', image_id=FAKE_IMAGE_ID),

View file

@ -16,10 +16,10 @@ ADMIN_ACCESS_USER = 'devtable'
class EndpointTestCase(unittest.TestCase): class EndpointTestCase(unittest.TestCase):
def setUp(self): def setUp(self):
setup_database_for_testing(self) setup_database_for_testing(self)
def tearDown(self): def tearDown(self):
finished_database_for_testing(self) finished_database_for_testing(self)
@ -68,13 +68,13 @@ class _SpecTestBuilder(type):
expected_status = getattr(test_spec, attrs['result_attr']) expected_status = getattr(test_spec, attrs['result_attr'])
test = _SpecTestBuilder._test_generator(url, expected_status, test = _SpecTestBuilder._test_generator(url, expected_status,
open_kwargs, open_kwargs,
session_vars) session_vars)
test_name_url = url.replace('/', '_').replace('-', '_') test_name_url = url.replace('/', '_').replace('-', '_')
sess_repo = str(test_spec.sess_repo).replace('/', '_') sess_repo = str(test_spec.sess_repo).replace('/', '_')
test_name = 'test_%s%s_%s' % (open_kwargs['method'].lower(), test_name = 'test_%s%s_%s' % (open_kwargs['method'].lower(),
test_name_url, sess_repo) test_name_url, sess_repo)
attrs[test_name] = test attrs[test_name] = test
return type(name, bases, attrs) return type(name, bases, attrs)