Path: blob/develop/tests/unit/customizations/servicecatalog/__init__.py
1569 views
# Copyright 2012-2017 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.1213from awscli.testutils import unittest14from awscli.testutils import mock15from awscli.customizations.servicecatalog import \16register_servicecatalog_commands, GenerateCommand17from awscli.customizations.servicecatalog import inject_commands181920class TestRegisterServiceCatalogCommands(unittest.TestCase):21def test_register_servicecatalog_commands(self):22event_emitter = mock.Mock()23register_servicecatalog_commands(event_emitter)24event_emitter.register.assert_has_calls(25[mock.call('building-command-table.servicecatalog', inject_commands)])262728class TestInjectCommands(unittest.TestCase):29def test_inject_commands(self):30command_table = {}31session = mock.Mock()32inject_commands(command_table, session)33self.assertIn('generate', command_table)34self.assertIsInstance(35command_table['generate'], GenerateCommand)363738