Path: blob/develop/tests/functional/ec2/test_describe_snapshots.py
1567 views
# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.1#2# Licensed under the Apache License, Version 2.0 (the "License"). You3# may not use this file except in compliance with the License. A copy of4# the License is located at5#6# http://aws.amazon.com/apache2.0/7#8# or in the "license" file accompanying this file. This file is9# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF10# ANY KIND, either express or implied. See the License for the specific11# language governing permissions and limitations under the License.12from awscli.testutils import BaseAWSCommandParamsTest131415class TestDescribeSnapshots(BaseAWSCommandParamsTest):1617prefix = 'ec2 describe-snapshots'1819def test_max_results_set_by_default(self):20command = self.prefix21params = {'MaxResults': 1000}22self.assert_params_for_cmd(command, params)2324def test_max_results_not_set_with_snapshot_ids(self):25command = self.prefix + ' --snapshot-ids snap-example'26params = {'SnapshotIds': ['snap-example']}27self.assert_params_for_cmd(command, params)2829def test_max_results_not_set_with_filter(self):30command = self.prefix + ' --filters Name=snapshot-id,Values=snap-snap'31params = {'Filters': [{32'Name': 'snapshot-id', 'Values': ['snap-snap']33}]}34self.assert_params_for_cmd(command, params)3536def test_max_results_not_overwritten(self):37command = self.prefix + ' --max-results 5'38params = {'MaxResults': 5}39self.assert_params_for_cmd(command, params)4041command = self.prefix + ' --page-size 5'42self.assert_params_for_cmd(command, params)434445