title: How do I test a module that depends on boto and an Amazon AWS service?
body: <p>I'm writing a very small Python ORM around <code>boto.dynamodb.layer2</code>. I would like to write tests for it, but I don't want the tests to actually communicate with AWS, as this would require complicated setup, credentials, network access, etc.</p>
  
  <p>Since I plan to open source the module, including credentials in the source seems like a bad idea since I will get charged for usage, and including credentials in the environment is a pain.</p>
  
  <p>Coupling my tests to the network seems like a bad idea, as it makes the tests run slower, or may cause tests to fail due to network errors or throttling. My goal is not to test boto's DynamoDB interface, or AWS. I just want to test my own code.</p>
  
  <p>I plan to use <a href="http://pypi.python.org/pypi/unittest2/" rel="noreferrer"><code>unittest2</code></a> to write the tests and <a href="http://pypi.python.org/pypi/mock/" rel="noreferrer"><code>mock</code></a> to mock out the parts of boto that hit the network, but I've never done this before, so my question boils down to these:</p>
  
  <ol>
  <li>Am I going about this the right way?</li>
  <li>Has anyone else done this?</li>
  <li>Are there any particular points in the <code>boto.dynamodb</code> interface that would be best to mock out?</li>
  </ol>