~tribaal/txaws/xss-hardening

« back to all changes in this revision

Viewing changes to txaws/testing/ec2.py

  • Committer: Duncan McGreggor
  • Date: 2009-08-28 02:32:44 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: duncan@canonical.com-20090828023244-6t44fi741heukb8p
- Fixed the creds parameter in the get_ec2_client method.
- Removed redundant code in check_parsed_instances.
- Created a testing subpackage for generally useful testing classes.
- Added fake ec2 client and region classes.
- Moved base test case into new testing module.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from twisted.internet.defer import succeed
 
2
 
 
3
 
 
4
class FakeEC2Client(object):
 
5
 
 
6
    def __init__(self, creds, endpoint, instances=[]):
 
7
        self.creds = creds
 
8
        self.endpoint = endpoint
 
9
        self.instances = instances
 
10
 
 
11
    def describe_instances(self):
 
12
        return succeed(self.instances)