Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aws
GitHub Repository: aws/aws-cli
Path: blob/develop/tests/functional/sqs/test_get_queue_attributes.py
1567 views
1
#!/usr/bin/env python
2
# Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
#
4
# Licensed under the Apache License, Version 2.0 (the "License"). You
5
# may not use this file except in compliance with the License. A copy of
6
# the License is located at
7
#
8
# http://aws.amazon.com/apache2.0/
9
#
10
# or in the "license" file accompanying this file. This file is
11
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
# ANY KIND, either express or implied. See the License for the specific
13
# language governing permissions and limitations under the License.
14
from awscli.testutils import BaseAWSCommandParamsTest
15
import awscli.clidriver
16
17
18
class TestGetQueueAttributes(BaseAWSCommandParamsTest):
19
20
prefix = 'sqs get-queue-attributes'
21
queue_url = 'https://queue.amazonaws.com/4444/testcli'
22
23
def test_no_attr(self):
24
cmdline = self.prefix + ' --queue-url %s' % self.queue_url
25
result = {'QueueUrl': self.queue_url}
26
self.assert_params_for_cmd(cmdline, result)
27
28
def test_all(self):
29
cmdline = self.prefix + ' --queue-url %s' % self.queue_url
30
cmdline += ' --attribute-names All'
31
result = {'QueueUrl': self.queue_url,
32
'AttributeNames': ['All']}
33
self.assert_params_for_cmd(cmdline, result)
34
35
def test_one(self):
36
cmdline = self.prefix + ' --queue-url %s' % self.queue_url
37
cmdline += ' --attribute-names VisibilityTimeout'
38
result = {'QueueUrl': self.queue_url,
39
'AttributeNames': ['VisibilityTimeout']}
40
self.assert_params_for_cmd(cmdline, result)
41
42
def test_two(self):
43
cmdline = self.prefix + ' --queue-url %s' % self.queue_url
44
cmdline += ' --attribute-names VisibilityTimeout QueueArn'
45
result = {'QueueUrl': self.queue_url,
46
'AttributeNames': ['VisibilityTimeout', 'QueueArn']}
47
self.assert_params_for_cmd(cmdline, result)
48
49
50
if __name__ == "__main__":
51
unittest.main()
52
53