Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aws
GitHub Repository: aws/aws-cli
Path: blob/develop/tests/unit/customizations/servicecatalog/test_generate.py
1569 views
1
# Copyright 2012-2017 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
# http://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
14
from argparse import Namespace
15
16
from awscli.customizations.servicecatalog import GenerateCommand
17
from awscli.testutils import unittest
18
19
20
class TestGenerateCommand(unittest.TestCase):
21
def setUp(self):
22
self.cmd = GenerateCommand(None)
23
24
def test_no_subcommand(self):
25
# Arrange
26
arguments = Namespace()
27
arguments.subcommand = None
28
29
# Act+Assert
30
with self.assertRaises(ValueError):
31
self.cmd._run_main(arguments, None)
32
33
def test_with_subcommand(self):
34
# Arrange
35
arguments = Namespace(subcommand="product")
36
37
# Act
38
self.cmd._run_main(arguments, None)
39
40