You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by bu...@apache.org on 2011/11/05 20:23:25 UTC

svn commit: r798141 - /websites/staging/libcloud/trunk/content/docs/

Author: buildbot
Date: Sat Nov  5 19:23:24 2011
New Revision: 798141

Log:
Staging update by buildbot

Added:
    websites/staging/libcloud/trunk/content/docs/writing-tests-and-using-the-fixture-framework.html
Modified:
    websites/staging/libcloud/trunk/content/docs/components.html
    websites/staging/libcloud/trunk/content/docs/compute-base-api.html
    websites/staging/libcloud/trunk/content/docs/compute-deployment.html
    websites/staging/libcloud/trunk/content/docs/compute-overview.html
    websites/staging/libcloud/trunk/content/docs/debugging.html
    websites/staging/libcloud/trunk/content/docs/index.html
    websites/staging/libcloud/trunk/content/docs/load-balancer-base-api.html
    websites/staging/libcloud/trunk/content/docs/load-balancer-examples.html
    websites/staging/libcloud/trunk/content/docs/load-balancer-overview.html
    websites/staging/libcloud/trunk/content/docs/storage-base-api.html
    websites/staging/libcloud/trunk/content/docs/storage-examples.html
    websites/staging/libcloud/trunk/content/docs/storage-overview.html
    websites/staging/libcloud/trunk/content/docs/using-libcloud-in-multi-threaded-and-async-environments.html

Modified: websites/staging/libcloud/trunk/content/docs/components.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/components.html (original)
+++ websites/staging/libcloud/trunk/content/docs/components.html Sat Nov  5 19:23:24 2011
@@ -55,12 +55,14 @@
             <li><a href="load-balancer-examples.html">Examples</a></li>
         </ul>
     </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
     <li>Other</li>
     <ul>
-        <ul>
-            <li><a href="debugging.html">Debugging</a></li>
-            <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
-        </ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
     </ul>
     <li><a href="/apidocs">Generated API docs</a></li>
 </ul>

Modified: websites/staging/libcloud/trunk/content/docs/compute-base-api.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/compute-base-api.html (original)
+++ websites/staging/libcloud/trunk/content/docs/compute-base-api.html Sat Nov  5 19:23:24 2011
@@ -55,12 +55,14 @@
             <li><a href="load-balancer-examples.html">Examples</a></li>
         </ul>
     </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
     <li>Other</li>
     <ul>
-        <ul>
-            <li><a href="debugging.html">Debugging</a></li>
-            <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
-        </ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
     </ul>
     <li><a href="/apidocs">Generated API docs</a></li>
 </ul>

Modified: websites/staging/libcloud/trunk/content/docs/compute-deployment.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/compute-deployment.html (original)
+++ websites/staging/libcloud/trunk/content/docs/compute-deployment.html Sat Nov  5 19:23:24 2011
@@ -55,12 +55,14 @@
             <li><a href="load-balancer-examples.html">Examples</a></li>
         </ul>
     </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
     <li>Other</li>
     <ul>
-        <ul>
-            <li><a href="debugging.html">Debugging</a></li>
-            <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
-        </ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
     </ul>
     <li><a href="/apidocs">Generated API docs</a></li>
 </ul>

Modified: websites/staging/libcloud/trunk/content/docs/compute-overview.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/compute-overview.html (original)
+++ websites/staging/libcloud/trunk/content/docs/compute-overview.html Sat Nov  5 19:23:24 2011
@@ -55,12 +55,14 @@
             <li><a href="load-balancer-examples.html">Examples</a></li>
         </ul>
     </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
     <li>Other</li>
     <ul>
-        <ul>
-            <li><a href="debugging.html">Debugging</a></li>
-            <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
-        </ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
     </ul>
     <li><a href="/apidocs">Generated API docs</a></li>
 </ul>

Modified: websites/staging/libcloud/trunk/content/docs/debugging.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/debugging.html (original)
+++ websites/staging/libcloud/trunk/content/docs/debugging.html Sat Nov  5 19:23:24 2011
@@ -55,12 +55,14 @@
             <li><a href="load-balancer-examples.html">Examples</a></li>
         </ul>
     </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
     <li>Other</li>
     <ul>
-        <ul>
-            <li><a href="debugging.html">Debugging</a></li>
-            <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
-        </ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
     </ul>
     <li><a href="/apidocs">Generated API docs</a></li>
 </ul>

Modified: websites/staging/libcloud/trunk/content/docs/index.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/index.html (original)
+++ websites/staging/libcloud/trunk/content/docs/index.html Sat Nov  5 19:23:24 2011
@@ -55,12 +55,14 @@
             <li><a href="load-balancer-examples.html">Examples</a></li>
         </ul>
     </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
     <li>Other</li>
     <ul>
-        <ul>
-            <li><a href="debugging.html">Debugging</a></li>
-            <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
-        </ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
     </ul>
     <li><a href="/apidocs">Generated API docs</a></li>
 </ul>
@@ -78,6 +80,9 @@
 browsing the documentation, click on the component in the menu on the left.</p>
 <p>If you have questions, suggestions or corrections, feel free to
 <a href="/devinfo.html">contact us</a>.</p>
+<p>Documentation is also freely available in the Markdown format in our SVN
+repository which means anyone can clonethe repository and help us improve
+it.</p>
       
     </div>
 

Modified: websites/staging/libcloud/trunk/content/docs/load-balancer-base-api.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/load-balancer-base-api.html (original)
+++ websites/staging/libcloud/trunk/content/docs/load-balancer-base-api.html Sat Nov  5 19:23:24 2011
@@ -55,12 +55,14 @@
             <li><a href="load-balancer-examples.html">Examples</a></li>
         </ul>
     </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
     <li>Other</li>
     <ul>
-        <ul>
-            <li><a href="debugging.html">Debugging</a></li>
-            <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
-        </ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
     </ul>
     <li><a href="/apidocs">Generated API docs</a></li>
 </ul>
@@ -120,7 +122,8 @@ members to it.</p>
 <h3 id="destroy_balancer">destroy_balancer</h3>
 
 <p><strong>Method signature</strong>:
-<a href="/apidocs/current/libcloud.loadbalancer.base.Driver.html#destroy_balancer">driver.destroy_balancer(balancer)</a><br />
+<a href="/apidocs/current/libcloud.loadbalancer.base.Driver.html#destroy_balancer">driver.destroy_balancer(balancer)</a>,
+<a href="/apidocs/current/libcloud.loadbalancer.base.LoadBalancer.html#destroy">balancer.destroy()</a><br />
 <strong>Description</strong>: Destroy a load balancer.</p>
 <h3 id="balancer_attach_member">balancer_attach_member</h3>
 

Modified: websites/staging/libcloud/trunk/content/docs/load-balancer-examples.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/load-balancer-examples.html (original)
+++ websites/staging/libcloud/trunk/content/docs/load-balancer-examples.html Sat Nov  5 19:23:24 2011
@@ -55,12 +55,14 @@
             <li><a href="load-balancer-examples.html">Examples</a></li>
         </ul>
     </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
     <li>Other</li>
     <ul>
-        <ul>
-            <li><a href="debugging.html">Debugging</a></li>
-            <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
-        </ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
     </ul>
     <li><a href="/apidocs">Generated API docs</a></li>
 </ul>

Modified: websites/staging/libcloud/trunk/content/docs/load-balancer-overview.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/load-balancer-overview.html (original)
+++ websites/staging/libcloud/trunk/content/docs/load-balancer-overview.html Sat Nov  5 19:23:24 2011
@@ -55,12 +55,14 @@
             <li><a href="load-balancer-examples.html">Examples</a></li>
         </ul>
     </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
     <li>Other</li>
     <ul>
-        <ul>
-            <li><a href="debugging.html">Debugging</a></li>
-            <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
-        </ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
     </ul>
     <li><a href="/apidocs">Generated API docs</a></li>
 </ul>

Modified: websites/staging/libcloud/trunk/content/docs/storage-base-api.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/storage-base-api.html (original)
+++ websites/staging/libcloud/trunk/content/docs/storage-base-api.html Sat Nov  5 19:23:24 2011
@@ -55,12 +55,14 @@
             <li><a href="load-balancer-examples.html">Examples</a></li>
         </ul>
     </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
     <li>Other</li>
     <ul>
-        <ul>
-            <li><a href="debugging.html">Debugging</a></li>
-            <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
-        </ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
     </ul>
     <li><a href="/apidocs">Generated API docs</a></li>
 </ul>

Modified: websites/staging/libcloud/trunk/content/docs/storage-examples.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/storage-examples.html (original)
+++ websites/staging/libcloud/trunk/content/docs/storage-examples.html Sat Nov  5 19:23:24 2011
@@ -55,12 +55,14 @@
             <li><a href="load-balancer-examples.html">Examples</a></li>
         </ul>
     </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
     <li>Other</li>
     <ul>
-        <ul>
-            <li><a href="debugging.html">Debugging</a></li>
-            <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
-        </ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
     </ul>
     <li><a href="/apidocs">Generated API docs</a></li>
 </ul>

Modified: websites/staging/libcloud/trunk/content/docs/storage-overview.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/storage-overview.html (original)
+++ websites/staging/libcloud/trunk/content/docs/storage-overview.html Sat Nov  5 19:23:24 2011
@@ -55,12 +55,14 @@
             <li><a href="load-balancer-examples.html">Examples</a></li>
         </ul>
     </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
     <li>Other</li>
     <ul>
-        <ul>
-            <li><a href="debugging.html">Debugging</a></li>
-            <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
-        </ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
     </ul>
     <li><a href="/apidocs">Generated API docs</a></li>
 </ul>

Modified: websites/staging/libcloud/trunk/content/docs/using-libcloud-in-multi-threaded-and-async-environments.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/using-libcloud-in-multi-threaded-and-async-environments.html (original)
+++ websites/staging/libcloud/trunk/content/docs/using-libcloud-in-multi-threaded-and-async-environments.html Sat Nov  5 19:23:24 2011
@@ -55,12 +55,14 @@
             <li><a href="load-balancer-examples.html">Examples</a></li>
         </ul>
     </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
     <li>Other</li>
     <ul>
-        <ul>
-            <li><a href="debugging.html">Debugging</a></li>
-            <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
-        </ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
     </ul>
     <li><a href="/apidocs">Generated API docs</a></li>
 </ul>

Added: websites/staging/libcloud/trunk/content/docs/writing-tests-and-using-the-fixture-framework.html
==============================================================================
--- websites/staging/libcloud/trunk/content/docs/writing-tests-and-using-the-fixture-framework.html (added)
+++ websites/staging/libcloud/trunk/content/docs/writing-tests-and-using-the-fixture-framework.html Sat Nov  5 19:23:24 2011
@@ -0,0 +1,184 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+  <title>Writing tests and using the fixture framework | Apache Libcloud Documentation</title>
+  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
+  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" type="text/javascript"></script>
+  <script src="/js/clearlink.js" type="text/javascript"></script>
+  <script src="/js/libcloud.js" type="text/javascript"></script>
+  <link rel="stylesheet" href="/css/screen.css" type="text/css">
+  <link rel="stylesheet" href="/css/libcloud.css" type="text/css">
+  <link rel="stylesheet" href="/css/documentation.css" type="text/css">
+  <link rel="stylesheet" href="/css/code.css" type="text/css">
+  <link rel="icon" type="image/png" href="/images/favicon.png"/>
+</head>
+<body>
+  <div class="container">
+    <div id="header" class="span-24 last">
+      
+      <h1>Apache Libcloud <span>a unified interface to the cloud</span></h1>
+      
+    </div>
+
+    <div id="banner" class="span-24 last">
+      
+      <h2>Libcloud
+                                             Documentation: Writing tests and using the fixture framework</h2>
+      
+  </div>
+
+    
+    <div id="sidebar" class="span-6 border">
+      
+<ul id="menu">
+    <li><a href="/index.html">Website home</a></li>
+    <li><a href="/docs/index.html">Documentation home</a></li>
+    <li><a href="/docs/components.html">Components</a></li>
+    <ul>
+        <li class="title">Compute</li>
+        <ul>
+            <li><a href="compute-overview.html">Overview</a></li>
+            <li><a href="compute-base-api.html">Base API</a></li>
+            <li><a href="compute-deployment.html">Deployment</a></li>
+        </ul>
+        <li class="title">Storage</li>
+        <ul>
+            <li><a href="storage-overview.html">Overview</a></li>
+            <li><a href="storage-base-api.html">Base API</a></li>
+            <li><a href="storage-examples.html">Examples</a></li>
+        </ul>
+        <li class="title">Load Balancer</li>
+        <ul>
+            <li><a href="load-balancer-overview.html">Overview</a></li>
+            <li><a href="load-balancer-base-api.html">Base API</a></li>
+            <li><a href="load-balancer-examples.html">Examples</a></li>
+        </ul>
+    </ul>
+    <li>Development</li>
+    <ul>
+        <li><a href="writing-tests-and-using-the-fixture-framework.html">Writing tests and using the fixture framework</a></li>
+    </ul>
+    <li>Other</li>
+    <ul>
+        <li><a href="debugging.html">Debugging</a></li>
+        <li><a href="using-libcloud-in-multi-threaded-and-async-environments.html">Using Libcloud in multi-threaded and async environments</a></li>
+    </ul>
+    <li><a href="/apidocs">Generated API docs</a></li>
+</ul>
+
+
+
+    </div>
+    
+
+    <div id="main" class="span-16 last">
+      
+      <h2 id="writing_tests_and_using_the_fixture_framework">Writing tests and using the fixture framework</h2>
+<p>This section describes how to write tests for the provider drivers and how to use
+our fixture framework and system for mocking the responses.</p>
+<p>Examples in this section refer to the compute API but things described in this
+section are also applicable to other APIs.</p>
+<ul>
+<li><a href="#creating-fixtures">Creating Fixtures</a></li>
+<li><a href="#mocking-responses-and-using-mockhttp-class">Mocking responses and using MockHttp class</a></li>
+<li><a href="#mock-http-class-example">MockHttp class example</a></li>
+</ul>
+<h3 id="creating-fixtures">Creating Fixtures</h3>
+
+<p>In our test cases fixtures store different responses returned by the provider APIs.
+They are stored and named in the following format:
+<code>test/&lt;api name&gt;/fixtures/&lt;provider name&gt;/&lt;fixture name&gt;</code>.</p>
+<p>Fixtures are usually generated by "manually" performing (usually using a tool like curl)
+different actions with the provider API and saving responses in the files.</p>
+<p><em>Note: You are advised against using the examples from the provider API docs because empirical
+evidence has shown that in a lot of cases they are wrong or out of date.</em></p>
+<h3 id="mocking-responses-and-using-mockhttp-class">Mocking responses and using MockHttp class</h3>
+
+<p>Each provider test file usually contains a class which inherits from the base <code>MockHttp</code> class.
+This class is responsible for loading fixtures and returning a mocked response for
+each API call.</p>
+<p>Which method is called is primary determined by the requested path. All the forward slashes,
+periods and dashes in the requested path are replaced by an underscore (<code>_</code>).</p>
+<p>Some examples:</p>
+<p><strong>Requested path</strong>: <code>/servers/list.all</code><br />
+<strong>use_params</strong>: <code>MockHttp.use_params = None</code><br />
+<strong>Name of the method on the Mock class</strong>: <code>_servers_list_all</code></p>
+<p><strong>Requested path</strong>: <code>/servers/reboot-all</code><br />
+<strong>use_params</strong>: <code>MockHttp.use_params = None</code><br />
+<strong>Name of the method on the Mock class</strong>: <code>_servers_reboot_all</code></p>
+<p>Some providers use the same path for all the requests and the actual action is determined by
+some parameter in a query string. To overcome this problem, set the <code>use_param</code> MockHttp class
+attribute to the name of the query string parameter which specifies the action.
+Good example of a provider API which does this is the Amazon EC2 API
+(<code>test/compute/test_ec2.py</code>).</p>
+<p>Example:</p>
+<p><strong>Requested path</strong>: <code>/?Action=RebootInstances&amp;InstanceId=12345</code><br />
+<strong>use_params</strong>: <code>MockHttp.use_params = 'Action'</code><br />
+<strong>Name of the method on the Mock class</strong>: <code>_RebootInstances</code></p>
+<p>Usually we also want to test different scenarios for a single API call.
+Good example of this is testing a success and different failure scenarios when creating a node.
+Because we are testing a single API call, this means that the request path will in most
+cases be the same. This makes loading a different response fixture for each API call
+without inspecting the request parameters or doing something similar very cumbersome.</p>
+<p>This problem can be overcome by setting the <code>type</code> attribute on the <code>MockHttp</code> class before
+issuing a request. The specified <code>type</code> will be automatically appended to the end of the
+constructed method name.</p>
+<p>Example:</p>
+<p><strong>Requested path</strong>: <code>/servers/reboot-all</code><br />
+<strong>use_params</strong>: <code>MockHttp.use_params = None</code><br />
+<strong>type</strong>: <code>MockHttp.type = 'FAILURE'</code><br />
+<strong>Name of the method on the Mock class</strong>: <code>_servers_reboot_all_FAILURE</code></p>
+<h3 id="mock-http-class-example">MockHttp class example</h3>
+
+<p>Bellow is an example of a MockHttp class from the Amazon EC2 tests with a
+single method.</p>
+<p>Return value of a mock method is a tuple - 
+<strong>(status_code, response_body, response_headers, response_status_string)</strong>.</p>
+<ul>
+<li><strong>response_code</strong> (intger) - response status code (httplib.OK, httplib.NOT_FOUND, ...)</li>
+<li><strong>response_body</strong> (string) - actual mocked response body which is usually read from a fixture</li>
+<li><strong>response_headers</strong> (dictionary) - response headers</li>
+<li>
+<p><strong>response_status_string</strong> (string) - string representation of the response status code (httplib.responses[httplib.OK], httplib.responses[httplib.CONTINUE], ...)</p>
+<p>::python
+class EC2MockHttp(MockHttp):</p>
+<div class="codehilite"><pre><span class="n">fixtures</span> <span class="o">=</span> <span class="n">ComputeFileFixtures</span><span class="p">(</span><span class="s">&#39;ec2&#39;</span><span class="p">)</span>
+
+<span class="n">def</span> <span class="n">_DescribeInstances</span><span class="p">(</span><span class="n">self</span><span class="p">,</span> <span class="n">method</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> <span class="n">body</span><span class="p">,</span> <span class="n">headers</span><span class="p">):</span>
+    <span class="n">body</span> <span class="o">=</span> <span class="n">self</span><span class="o">.</span><span class="n">fixtures</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="s">&#39;describe_instances.xml&#39;</span><span class="p">)</span>
+    <span class="k">return</span> <span class="p">(</span><span class="n">httplib</span><span class="o">.</span><span class="n">OK</span><span class="p">,</span> <span class="n">body</span><span class="p">,</span> <span class="p">{</span><span class="s">&#39;Content-Type&#39;</span><span class="p">:</span> <span class="s">&#39;application/xml&#39;</span><span class="p">},</span> <span class="n">httplib</span><span class="o">.</span><span class="n">responses</span><span class="p">[</span><span class="n">httplib</span><span class="o">.</span><span class="n">OK</span><span class="p">])</span>
+</pre></div>
+
+
+</li>
+</ul>
+      
+    </div>
+
+    <div id="footer" class="span-24">
+    <a href="http://www.apache.org/licenses/">License</a> | <a
+    href="/security.html">Security</a> | <a
+    href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a> |
+<a href="http://www.apache.org/foundation/thanks.html">Thanks</a> | <a
+    href="/credits.html">Credits</a> | <a href="/sitemap.html">Sitemap</a><br /><br />
+
+Copyright © 2009-2011, <a href="http://apache.org/">The Apache Software Foundation</a><br />
+Apache Libcloud, Libcloud, Apache, the Apache feather, and the Apache Libcloud
+project logo are trademarks of the Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+
+    </div>
+  </div>
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+try {
+var pageTracker = _gat._getTracker("UA-23580482-1");
+pageTracker._trackPageview();
+} catch(err) {}
+</script>
+
+</body>
+</html>