Related  change is If5d00a7f7991d78243e76a6e22031c185caee80a

Add new action in tests.v1.fakes.FakeHTTPClient, so it allow to test
os-begin_detaching and os-roll_detaching.
Fix typo in tests/v1/test_volumes.py.

Change-Id: I5c4cd9cc56a7235036b6bab6641554b5919ffbb6
This commit is contained in:
Rongze Zhu 2012-09-12 02:55:45 +00:00
parent a4d4601432
commit 5997e233e1
2 changed files with 7 additions and 3 deletions

@ -163,6 +163,10 @@ class FakeHTTPClient(base_client.HTTPClient):
return (202, {'connection_info': 'foos'})
elif action == 'os-terminate_connection':
assert body[action].keys() == ['connector']
elif action == 'os-begin_detaching':
assert body[action] == None
elif action == 'os-roll_detaching':
assert body[action] == None
else:
raise AssertionError("Unexpected server action: %s" % action)
return (resp, _body)

@ -38,17 +38,17 @@ class VolumesTest(utils.TestCase):
def test_unreserve(self):
v = cs.volumes.get('1234')
cs.volumes.reserve(v)
cs.volumes.unreserve(v)
cs.assert_called('POST', '/volumes/1234/action')
def test_begin_detaching(self):
v = cs.volumes.get('1234')
cs.volumes.reserve(v)
cs.volumes.begin_detaching(v)
cs.assert_called('POST', '/volumes/1234/action')
def test_roll_detaching(self):
v = cs.volumes.get('1234')
cs.volumes.reserve(v)
cs.volumes.roll_detaching(v)
cs.assert_called('POST', '/volumes/1234/action')
def test_initialize_connection(self):