Path: blob/develop/tests/unit/customizations/gamelift/__init__.py
1569 views
# Copyright 2015 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.12from awscli.testutils import unittest13from awscli.testutils import mock14from awscli.customizations.gamelift import register_gamelift_commands15from awscli.customizations.gamelift import inject_commands16from awscli.customizations.gamelift.uploadbuild import UploadBuildCommand17from awscli.customizations.gamelift.getlog import GetGameSessionLogCommand181920class TestRegisterGameLiftCommands(unittest.TestCase):21def test_register_gamelift_commands(self):22event_emitter = mock.Mock()23register_gamelift_commands(event_emitter)24event_emitter.register.assert_called_once_with(25'building-command-table.gamelift', inject_commands)262728class TestInjectCommands(unittest.TestCase):29def test_inject_commands(self):30command_table = {}31session = mock.Mock()32inject_commands(command_table, session)33self.assertIn('upload-build', command_table)34self.assertIsInstance(35command_table['upload-build'], UploadBuildCommand)36self.assertIn('get-game-session-log', command_table)37self.assertIsInstance(38command_table['get-game-session-log'], GetGameSessionLogCommand)394041