| 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 |
# https://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 boto3.docs.service import ServiceDocumenter |
| 14 |
from boto3.session import Session |
| 15 |
from tests.functional.docs import BaseDocsFunctionalTests |
| 16 |
|
| 17 |
|
| 18 |
class TestInstanceDeleteTags(BaseDocsFunctionalTests): |
| 19 |
def setUp(self): |
| 20 |
super().setUp() |
| 21 |
self.documenter = ServiceDocumenter( |
| 22 |
'ec2', |
| 23 |
session=Session(region_name='us-east-1'), |
| 24 |
root_docs_path=self.root_services_path, |
| 25 |
) |
| 26 |
self.generated_contents = self.documenter.document_service() |
| 27 |
self.generated_contents = self.generated_contents.decode('utf-8') |
| 28 |
|
| 29 |
def test_delete_tags_method_is_documented(self): |
| 30 |
self.assert_contains_lines_in_order( |
| 31 |
[ |
| 32 |
'=========', |
| 33 |
'Resources', |
| 34 |
'=========', |
| 35 |
'The available resources are:', |
| 36 |
' ec2/instance/index', |
| 37 |
], |
| 38 |
self.generated_contents, |
| 39 |
) |
| 40 |
self.assert_contains_lines_in_order( |
| 41 |
[ |
| 42 |
'.. py:class:: EC2.Instance', |
| 43 |
' delete_tags', |
| 44 |
], |
| 45 |
self.get_nested_file_contents('ec2', 'instance', 'index'), |
| 46 |
) |
| 47 |
self.assert_contains_lines_in_order( |
| 48 |
[ |
| 49 |
'delete_tags', |
| 50 |
'.. py:method:: EC2.Instance.delete_tags(**kwargs)', |
| 51 |
'response = instance.delete_tags(', |
| 52 |
'DryRun=True|False,', |
| 53 |
'Tags=[', |
| 54 |
], |
| 55 |
self.get_nested_file_contents('ec2', 'instance', 'delete_tags'), |
| 56 |
) |