Path: blob/develop/tests/functional/kinesis/test_list_streams.py
1567 views
# Copyright 2022 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.12import json1314from awscli.testutils import BaseAWSCommandParamsTest, BaseAWSHelpOutputTest151617class TestListStreams(BaseAWSCommandParamsTest):1819prefix = ['kinesis', 'list-streams']2021def test_exclusive_start_stream_name_disables_auto_pagination(self):22cmdline = self.prefix + ['--exclusive-start-stream-name', 'stream-1']23self.parsed_responses = [24{25'StreamNames': ['stream-1', 'stream-2'],26'StreamSummaries': [27{'StreamName': 'stream-1'},28{'StreamName': 'stream-2'},29],30'HasMoreStreams': True,31'NextToken': 'token',32}33]34expected_params = {'ExclusiveStartStreamName': 'stream-1'}35stdout, _, _ = self.assert_params_for_cmd(cmdline, expected_params)36output = json.dumps(stdout)37self.assertIn('NextToken', output)38self.assertIn('HasMoreStreams', output)3940def test_exclusive_start_stream_name_incompatible_with_page_args(self):41cmdline = self.prefix + ['--exclusive-start-stream-name', 'stream-1']42cmdline += ['--page-size', '1']43_, stderr, _ = self.run_cmd(cmdline, expected_rc=255)44self.assertIn('Error during pagination: Cannot specify', stderr)45self.assertIn('--page-size', stderr)464748class TestListStreamsHelp(BaseAWSHelpOutputTest):49def test_exclusive_start_stream_name_is_undocumented(self):50self.driver.main(['kinesis', 'list-streams', 'help'])51self.assert_not_contains('--exclusive-start-steam-name')525354