From 5997e233e165fb865b350577aaa8e15366846866 Mon Sep 17 00:00:00 2001
From: Rongze Zhu <zrzhit@gmail.com>
Date: Wed, 12 Sep 2012 02:55:45 +0000
Subject: [PATCH] Patch for bug #1004382

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
---
 tests/v1/fakes.py        | 4 ++++
 tests/v1/test_volumes.py | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/v1/fakes.py b/tests/v1/fakes.py
index d93c9a46f..2fb6bb3da 100644
--- a/tests/v1/fakes.py
+++ b/tests/v1/fakes.py
@@ -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)
diff --git a/tests/v1/test_volumes.py b/tests/v1/test_volumes.py
index f05b6fb68..5600ddc4e 100644
--- a/tests/v1/test_volumes.py
+++ b/tests/v1/test_volumes.py
@@ -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):