Skip to content

Commit 4393806

Browse files
author
Matthew Fisher
committed
move config test to before initial release
This is so that we can test the new functionality introduced in #625. Thanks go to clocKwize on IRC for catching this!
1 parent 0afb358 commit 4393806

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

api/tests/test_release.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,26 @@ def test_release(self):
5858
response = self.client.post(url, json.dumps(body), content_type='application/json')
5959
self.assertEqual(response.status_code, 201)
6060
app_id = response.data['id']
61+
# check that updating config rolls a new release
62+
url = '/api/apps/{app_id}/config'.format(**locals())
63+
body = {'values': json.dumps({'NEW_URL1': 'http://localhost:8080/'})}
64+
response = self.client.post(
65+
url, json.dumps(body), content_type='application/json')
66+
self.assertEqual(response.status_code, 201)
67+
self.assertIn('NEW_URL1', json.loads(response.data['values']))
6168
# check to see that an initial release was created
6269
url = '/api/apps/{app_id}/releases'.format(**locals())
6370
response = self.client.get(url)
6471
self.assertEqual(response.status_code, 200)
65-
self.assertEqual(response.data['count'], 1)
72+
# account for the config release as well
73+
self.assertEqual(response.data['count'], 2)
6674
url = '/api/apps/{app_id}/releases/v1'.format(**locals())
6775
response = self.client.get(url)
6876
self.assertEqual(response.status_code, 200)
6977
release1 = response.data
7078
self.assertIn('config', response.data)
7179
self.assertIn('build', response.data)
7280
self.assertEquals(release1['version'], 1)
73-
# check that updating config rolls a new release
74-
url = '/api/apps/{app_id}/config'.format(**locals())
75-
body = {'values': json.dumps({'NEW_URL1': 'http://localhost:8080/'})}
76-
response = self.client.post(
77-
url, json.dumps(body), content_type='application/json')
78-
self.assertEqual(response.status_code, 201)
79-
self.assertIn('NEW_URL1', json.loads(response.data['values']))
8081
# check to see that a new release was created
8182
url = '/api/apps/{app_id}/releases/v2'.format(**locals())
8283
response = self.client.get(url)

0 commit comments

Comments
 (0)