diff options
author | Brian Waldon <brian.waldon@rackspace.com> | 2011-08-10 13:46:34 -0400 |
---|---|---|
committer | Brian Waldon <brian.waldon@rackspace.com> | 2011-08-10 13:46:34 -0400 |
commit | 4b5b0b6edf809dbca0069f00c4cdbd04f532c772 (patch) | |
tree | 6d9d0af595fc6349667dd2ea5aad63ee39f3f0d4 | |
parent | f6273ba08d6ccf87c3e6c8e8c54ef3c934b41646 (diff) | |
download | python-novaclient-4b5b0b6edf809dbca0069f00c4cdbd04f532c772.tar.gz |
adding unittest
-rw-r--r-- | setup.cfg | 1 | ||||
-rw-r--r-- | tests/test_http.py | 11 |
2 files changed, 11 insertions, 1 deletions
@@ -1,5 +1,4 @@ [nosetests] -with-coverage = true cover-package = novaclient cover-html = true cover-erase = true diff --git a/tests/test_http.py b/tests/test_http.py index 77f2de15..5c808566 100644 --- a/tests/test_http.py +++ b/tests/test_http.py @@ -2,6 +2,7 @@ import httplib2 import mock from novaclient import client +from novaclient import exceptions from tests import utils @@ -54,3 +55,13 @@ class ClientTest(utils.TestCase): headers=headers, body='[1, 2, 3]') test_post_call() + + def test_auth_failure(self): + cl = get_client() + + # response must not have x-server-management-url header + @mock.patch.object(httplib2.Http, "request", mock_request) + def test_auth_call(): + self.assertRaises(exceptions.AuthorizationFailure, cl.authenticate) + + test_auth_call() |