Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aws
GitHub Repository: aws/aws-cli
Path: blob/develop/tests/functional/ec2/test_describe_snapshots.py
1567 views
1
# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License"). You
4
# may not use this file except in compliance with the License. A copy of
5
# the License is located at
6
#
7
# http://aws.amazon.com/apache2.0/
8
#
9
# or in the "license" file accompanying this file. This file is
10
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
# ANY KIND, either express or implied. See the License for the specific
12
# language governing permissions and limitations under the License.
13
from awscli.testutils import BaseAWSCommandParamsTest
14
15
16
class TestDescribeSnapshots(BaseAWSCommandParamsTest):
17
18
prefix = 'ec2 describe-snapshots'
19
20
def test_max_results_set_by_default(self):
21
command = self.prefix
22
params = {'MaxResults': 1000}
23
self.assert_params_for_cmd(command, params)
24
25
def test_max_results_not_set_with_snapshot_ids(self):
26
command = self.prefix + ' --snapshot-ids snap-example'
27
params = {'SnapshotIds': ['snap-example']}
28
self.assert_params_for_cmd(command, params)
29
30
def test_max_results_not_set_with_filter(self):
31
command = self.prefix + ' --filters Name=snapshot-id,Values=snap-snap'
32
params = {'Filters': [{
33
'Name': 'snapshot-id', 'Values': ['snap-snap']
34
}]}
35
self.assert_params_for_cmd(command, params)
36
37
def test_max_results_not_overwritten(self):
38
command = self.prefix + ' --max-results 5'
39
params = {'MaxResults': 5}
40
self.assert_params_for_cmd(command, params)
41
42
command = self.prefix + ' --page-size 5'
43
self.assert_params_for_cmd(command, params)
44
45