The default empty list values for groups and instances will be
inadvertently shared by all Reservation instances that don't provide
explicit values during instantiation. I recommend you use None and
set the value in the body of the constructor as necessary.
It would be nice to avoid accessing the private _parse_reservation
method by passing a query_factory to EC2Client that returns a
FakeQuery. FakeQuery.submit could return a succeeded deferred and
you could call ec2.describe_instances to get a Deferred with the
result you want to make assertions about.
[1]
+ def __init__(self, reservation_id, owner_id, groups=[], instances=[]):
The default empty list values for groups and instances will be
inadvertently shared by all Reservation instances that don't provide
explicit values during instantiation. I recommend you use None and
set the value in the body of the constructor as necessary.
[2]
+ def test_parse_ reservation( self): EC2Client( creds=' foo') reservation( sample_ describe_ instances_ result) parsed_ reservations( results)
+ ec2 = client.
+ results = ec2._parse_
+ self.check_
It would be nice to avoid accessing the private _parse_reservation instances to get a Deferred with the
method by passing a query_factory to EC2Client that returns a
FakeQuery. FakeQuery.submit could return a succeeded deferred and
you could call ec2.describe_
result you want to make assertions about.
+1 considering #1.