예제 #1
0
    def test_enable_versioning(self):
        args = default_args()
        action = DeployAction(args)
        eq_(action._enable_versioning(), True)

        args.publish = False
        action = DeployAction(args)
        eq_(action._enable_versioning(), True)
예제 #2
0
    def test_enable_versioning(self):
        args = default_args()
        action = DeployAction(args)
        eq_(action._enable_versioning(), True)

        args.publish = False
        action = DeployAction(args)
        eq_(action._enable_versioning(), True)
예제 #3
0
 def test_print_capacity(self):
     action = DeployAction(default_args())
     action._print_capacity(1000000, 200000)
     action._print_capacity(1000000, -200)
예제 #4
0
    def test_action(self, a):
        # Dry run
        with patch('lamvery.actions.base.LambdaClient') as c:
            action = DeployAction(default_args())
            action._print_conf_diff = Mock()
            action._print_capacity = Mock()
            action.action()

            # No dry run
            args = default_args()
            args.dry_run = False
            action = DeployAction(args)
            action._print_conf_diff = Mock()
            action._print_capacity = Mock()
        # New
        with patch('lamvery.actions.base.LambdaClient') as c:
            action._enable_versioning = Mock(return_value=False)
            c.get_function_conf = Mock(return_value={})
            action._get_client = Mock(return_value=c)
            action.action()
        # Update
        with patch('lamvery.actions.base.LambdaClient') as c:
            action._enable_versioning = Mock(return_value=False)
            c.get_function_conf = Mock(return_value={'CodeSize': 100})
            action._get_client = Mock(return_value=c)
            action.action()
        # Update (versioning)
        with patch('lamvery.actions.base.LambdaClient') as c:
            action._enable_versioning = Mock(return_value=True)
            c.get_function_conf = Mock(return_value={'CodeSize': 100})
            action._get_client = Mock(return_value=c)
            action.action()

        # Single File
        with patch('lamvery.actions.base.LambdaClient') as c:
            args = default_args()
            args.single_file = True
            action = DeployAction(args)
            action._print_conf_diff = Mock()
            action._print_capacity = Mock()
            action.action()
예제 #5
0
 def test_print_capacity(self):
     action = DeployAction(default_args())
     action._print_capacity(1000000, 200000)
     action._print_capacity(1000000, -200)
예제 #6
0
    def test_action(self, a):
        # Dry run
        with patch('lamvery.actions.base.Client') as c:
            action = DeployAction(default_args())
            action._print_conf_diff = Mock()
            action._print_capacity = Mock()
            action.action()

            # No dry run
            args = default_args()
            args.dry_run = False
            action = DeployAction(args)
            action._print_conf_diff = Mock()
            action._print_capacity = Mock()
        # New
        with patch('lamvery.actions.base.Client') as c:
            action._enable_versioning = Mock(return_value=False)
            c.get_function_conf = Mock(return_value={})
            action.get_client = Mock(return_value=c)
            action.action()
        # Update
        with patch('lamvery.actions.base.Client') as c:
            action._enable_versioning = Mock(return_value=False)
            c.get_function_conf = Mock(return_value={'CodeSize': 100})
            action.get_client = Mock(return_value=c)
            action.action()
        # Update (versioning)
        with patch('lamvery.actions.base.Client') as c:
            action._enable_versioning = Mock(return_value=True)
            c.get_function_conf = Mock(return_value={'CodeSize': 100})
            action.get_client = Mock(return_value=c)
            action.action()

        # Single File
        with patch('lamvery.actions.base.Client') as c:
            args = default_args()
            args.single_file = True
            action = DeployAction(args)
            action._print_conf_diff = Mock()
            action._print_capacity = Mock()
            action.action()