adding unittest
This commit is contained in:
parent
f6273ba08d
commit
4b5b0b6edf
@ -1,5 +1,4 @@
|
||||
[nosetests]
|
||||
with-coverage = true
|
||||
cover-package = novaclient
|
||||
cover-html = true
|
||||
cover-erase = true
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user