Skip to content
Permalink
Browse files

fix(tests): sort domains in tests to get past occasional ordering pro…

…blems which cause test failures

Fixes #886
  • Loading branch information...
helgi committed Jul 16, 2016
1 parent fb1bf97 commit f403efb610787faee46225aa9e63f0ae8abeb525
Showing with 8 additions and 8 deletions.
  1. +4 −4 rootfs/api/tests/deployments/test_domain.py
  2. +4 −4 rootfs/api/tests/test_domain.py
@@ -111,7 +111,7 @@ def test_manage_idn_domain(self):
url = '/v2/apps/{app_id}/domains'.format(app_id=self.app_id)
response = self.client.get(url)
expected = [data['domain'] for data in response.data['results']]
self.assertEqual([self.app_id, ace_domain], expected, msg)
self.assertEqual(sorted([self.app_id, ace_domain]), sorted(expected), msg)

# Verify creation failure for same domain with different encoding
if ace_domain != domain:
@@ -148,7 +148,7 @@ def test_manage_idn_domain(self):
url = '/v2/apps/{app_id}/domains'.format(app_id=self.app_id)
response = self.client.get(url)
expected = [data['domain'] for data in response.data['results']]
self.assertEqual([self.app_id, ace_domain], expected, msg)
self.assertEqual(sorted([self.app_id, ace_domain]), sorted(expected), msg)

# Delete
url = '/v2/apps/{app_id}/domains/{hostname}'.format(hostname=ace_domain,
@@ -175,7 +175,7 @@ def test_manage_idn_domain(self):
url = '/v2/apps/{app_id}/domains'.format(app_id=self.app_id)
response = self.client.get(url)
expected = [data['domain'] for data in response.data['results']]
self.assertEqual([self.app_id, ace_domain], expected, msg)
self.assertEqual(sorted([self.app_id, ace_domain]), sorted(expected), msg)

# Delete
url = '/v2/apps/{app_id}/domains/{hostname}'.format(hostname=unicode_domain,
@@ -220,7 +220,7 @@ def test_manage_domain(self):
url = '/v2/apps/{app_id}/domains'.format(app_id=self.app_id)
response = self.client.get(url)
expected = [data['domain'] for data in response.data['results']]
self.assertEqual([self.app_id, domain], expected, msg)
self.assertEqual(sorted([self.app_id, domain]), sorted(expected), msg)

# Delete
url = '/v2/apps/{app_id}/domains/{hostname}'.format(hostname=domain,
@@ -109,7 +109,7 @@ def test_manage_idn_domain(self):
url = '/v2/apps/{app_id}/domains'.format(app_id=self.app_id)
response = self.client.get(url)
expected = [data['domain'] for data in response.data['results']]
self.assertEqual([self.app_id, ace_domain], expected, msg)
self.assertEqual(sorted([self.app_id, ace_domain]), sorted(expected), msg)

# Verify creation failure for same domain with different encoding
if ace_domain != domain:
@@ -146,7 +146,7 @@ def test_manage_idn_domain(self):
url = '/v2/apps/{app_id}/domains'.format(app_id=self.app_id)
response = self.client.get(url)
expected = [data['domain'] for data in response.data['results']]
self.assertEqual([self.app_id, ace_domain], expected, msg)
self.assertEqual(sorted([self.app_id, ace_domain]), sorted(expected), msg)

# Delete
url = '/v2/apps/{app_id}/domains/{hostname}'.format(hostname=ace_domain,
@@ -173,7 +173,7 @@ def test_manage_idn_domain(self):
url = '/v2/apps/{app_id}/domains'.format(app_id=self.app_id)
response = self.client.get(url)
expected = [data['domain'] for data in response.data['results']]
self.assertEqual([self.app_id, ace_domain], expected, msg)
self.assertEqual(sorted([self.app_id, ace_domain]), sorted(expected), msg)

# Delete
url = '/v2/apps/{app_id}/domains/{hostname}'.format(hostname=unicode_domain,
@@ -218,7 +218,7 @@ def test_manage_domain(self):
url = '/v2/apps/{app_id}/domains'.format(app_id=self.app_id)
response = self.client.get(url)
expected = [data['domain'] for data in response.data['results']]
self.assertEqual([self.app_id, domain], expected, msg)
self.assertEqual(sorted([self.app_id, domain]), sorted(expected), msg)

# Delete
url = '/v2/apps/{app_id}/domains/{hostname}'.format(hostname=domain,

0 comments on commit f403efb

Please sign in to comment.
You can’t perform that action at this time.