Ejemplo n.º 1
0
 def test_exception_missing_parameter_no_value_non_guided(self):
     stack_name = None
     mock_params = MagicMock()
     mock_params.get = MagicMock(return_value=False)
     with self.assertRaises(click.BadOptionUsage):
         guided_deploy_stack_name(
             ctx=MockContext(info_name="test", parent=None, params=mock_params),
             param=MagicMock(),
             provided_value=stack_name,
         )
Ejemplo n.º 2
0
 def test_must_return_provided_value_non_guided(self):
     stack_name = "provided-stack"
     mock_params = MagicMock()
     mock_params.get = MagicMock(return_value=False)
     result = guided_deploy_stack_name(ctx=MagicMock(),
                                       param=MagicMock(),
                                       provided_value=stack_name)
     self.assertEqual(result, "provided-stack")
Ejemplo n.º 3
0
 def test_must_return_default_value_guided(self):
     stack_name = None
     mock_params = MagicMock()
     mock_params.get = MagicMock(return_value=True)
     result = guided_deploy_stack_name(
         ctx=MockContext(info_name="test", parent=None, params=mock_params),
         param=MagicMock(),
         provided_value=stack_name,
     )
     self.assertEqual(result, "sam-app")