-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #230 from JensTimmerman/cleanup
added test + fixes
- Loading branch information
Showing
3 changed files
with
42 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
@author: Jens Timmerman (Ghent University) | ||
""" | ||
import os | ||
from urllib2 import HTTPError | ||
|
||
from vsc.install.testing import TestCase | ||
|
||
|
@@ -68,9 +69,17 @@ def test_client(self): | |
self.assertEqual(status, 200) | ||
self.assertEqual(body['merge_commit_sha'], u'fba3e13815f3d2a9dfbd2f89f1cf678dd58bb1f1') | ||
|
||
def suite(): | ||
""" returns all the testcases in this module """ | ||
return TestLoader().loadTestsFromTestCase(RestClientTest) | ||
|
||
if __name__ == '__main__': | ||
main() | ||
def test_request_methods(self): | ||
"""Test all request methods""" | ||
status, body = self.client.head() | ||
self.assertEqual(status, 200) | ||
try: | ||
status, body = self.client.user.emails.post(body='[email protected]') | ||
self.assertTrue(False, 'posting to unauthorized endpoint did not trhow a http error') | ||
except HTTPError: | ||
pass | ||
try: | ||
status, body = self.client.user.emails.delete(body='[email protected]') | ||
self.assertTrue(False, 'deleting to unauthorized endpoint did not trhow a http error') | ||
except HTTPError: | ||
pass |