@@ -0,0 +1,1696 @@
+# Copyright 2015 Isotoma Limited%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A#   http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A%0Aimport unittest%0A%0Afrom botocore.stub import Stubber%0A%0Afrom touchdown import frontends%0Afrom touchdown.core import goals, workspace%0Afrom touchdown.core.map import SerialMap%0A%0A%0Aclass TestBucketDescribe(unittest.TestCase):%0A%0A    def setUp(self):%0A        self.workspace = workspace.Workspace()%0A        self.aws = self.workspace.add_aws(access_key_id='dummy', secret_access_key='dummy', region='eu-west-1')%0A        self.goal = goals.create(%0A            %22apply%22,%0A            self.workspace,%0A            frontends.ConsoleFrontend(interactive=False),%0A            map=SerialMap%0A        )%0A%0A    def test_annotate_object(self):%0A        rule = self.aws.add_rule(name=%22myrule%22)%0A        desc = self.goal.get_service(rule, %22describe%22)%0A%0A        stub = Stubber(desc.client)%0A%0A        stub.add_response(%0A            'get_rule',%0A            %7B'Rule': %7B%0A                'RuleId': 'ZzZzZz',%0A                'Predicates': %5B%5D,%0A            %7D%7D,%0A            %7B'RuleId': 'ZzZzZz'%7D,%0A        )%0A%0A        with stub:%0A            obj = desc.annotate_object(%7B%0A                %22RuleId%22: %22ZzZzZz%22%0A            %7D)%0A%0A        self.assertEqual(obj%5B%22RuleId%22%5D, %22ZzZzZz%22)%0A

Test 'annotate_object' for a WAF rule