Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aguilerapy committed Jun 18, 2020
1 parent 9511870 commit 2d46a91
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_send_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_receive_result(self):
response = self.client.get(content['url'] + '?destination=function')
self.assertEqual(response.status_code, 200)

response = self.client.get('/result/receive/')
response = self.client.get('/result/receive/?type=release-package')
self.assertEqual(response.status_code, 200)
json_data = json.loads(response.content.decode('utf-8'))
self.assertEqual(json_data.get('receive_result'), True)
Expand All @@ -45,6 +45,17 @@ def test_receive_result(self):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content, b'{"receive_result": false}')

def test_receive_result_invalid_type(self):
self.url = '/package-releases/'
content = self.upload_and_go({'type': 'release-package'})

response = self.client.get(content['url'] + '?destination=function')
self.assertEqual(response.status_code, 200)

response = self.client.get('/result/receive/?type=release release-array')
self.assertEqual(response.status_code, 400)
self.assertEqual(response.content, b'Not a release or list of releases')

def test_not_receive_result(self):
response = self.client.get('/result/receive/')
self.assertEqual(response.status_code, 200)
Expand Down

0 comments on commit 2d46a91

Please sign in to comment.