from tests import unittest
import botocore.session
from botocore.exceptions import ClientError
class TestRoute53Pagination(unittest.TestCase):
def setUp(self):
self.session = botocore.session.get_session()
self.client = self.session.create_client('route53', 'us-west-2')
def test_paginate_with_max_items(self):
paginator = self.client.get_paginator('list_hosted_zones')
results = list(paginator.paginate(PaginationConfig={'MaxItems': '1'}))
self.assertTrue(len(results) >= 0)
def test_paginate_with_deprecated_paginator_and_limited_input_tokens(self):
paginator = self.client.get_paginator('list_resource_record_sets')
with self.assertRaises(ClientError):
results = list(paginator.paginate(
PaginationConfig={
'MaxItems': '1',
'StartingToken': 'my.domain.name.'
},
HostedZoneId="foo"
))
self.assertTrue(len(results) >= 0)
if __name__ == '__main__':
unittest.main()