summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel G. Taylor <danielgtaylor@gmail.com>2013-11-26 14:34:54 -0800
committerDaniel G. Taylor <danielgtaylor@gmail.com>2013-11-26 14:51:00 -0800
commit7a0ac7f45ff39aaf33f6800443ec73a16f0c33b5 (patch)
tree0558c85c1e8ddc70223ecc801c39ad35dc9ecb35 /tests
parent29cff97bc03a4f6a4bc42e1655aabc8420ffc6a1 (diff)
downloadboto-7a0ac7f45ff39aaf33f6800443ec73a16f0c33b5.tar.gz
Add max results parameters to EC2 describe instances and describe tags calls. Also updates describe spot instance price history call with a max results parameter.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/ec2/test_connection.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/unit/ec2/test_connection.py b/tests/unit/ec2/test_connection.py
index 0546f4a7..0ae34013 100644
--- a/tests/unit/ec2/test_connection.py
+++ b/tests/unit/ec2/test_connection.py
@@ -1256,5 +1256,62 @@ class TestTerminateInstances(TestEC2ConnectionBase):
self.ec2.terminate_instances('foo')
+class TestDescribeInstances(TestEC2ConnectionBase):
+
+ def default_body(self):
+ return """
+ <DescribeInstancesResponse>
+ </DescribeInstancesResponse>
+ """
+
+ def test_default_behavior(self):
+ self.set_http_response(status_code=200)
+ self.ec2.get_all_instances()
+ self.assert_request_parameters({
+ 'Action': 'DescribeInstances'},
+ ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
+ 'SignatureVersion', 'Timestamp', 'Version'])
+
+ def test_max_results(self):
+ self.set_http_response(status_code=200)
+ self.ec2.get_all_instances(
+ max_results=10
+ )
+ self.assert_request_parameters({
+ 'Action': 'DescribeInstances',
+ 'MaxResults': 10},
+ ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
+ 'SignatureVersion', 'Timestamp', 'Version'])
+
+
+class TestDescribeTags(TestEC2ConnectionBase):
+
+ def default_body(self):
+ return """
+ <DescribeTagsResponse>
+ </DescribeTagsResponse>
+ """
+
+ def test_default_behavior(self):
+ self.set_http_response(status_code=200)
+ self.ec2.get_all_tags()
+ self.assert_request_parameters({
+ 'Action': 'DescribeTags'},
+ ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
+ 'SignatureVersion', 'Timestamp', 'Version'])
+
+ def test_max_results(self):
+ self.set_http_response(status_code=200)
+ self.ec2.get_all_tags(
+ max_results=10
+ )
+ self.assert_request_parameters({
+ 'Action': 'DescribeTags',
+ 'MaxResults': 10},
+ ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
+ 'SignatureVersion', 'Timestamp', 'Version'])
+
+
+
if __name__ == '__main__':
unittest.main()