def test_class_delete(self):
     ctx = self._get_ctx()
     with patch(PATCH_PREFIX + 'LambdaBase'):
         fun = permission.LambdaPermission(ctx)
         fun.logger = MagicMock()
         fun.resource_id = 'test_id'
         params = {"test": "test"}
         fun.client = self.make_client_function('remove_permission',
                                                return_value='response')
         fun.delete(params)
         self.assertIn('StatementId', params)
Example #2
0
 def test_class_create(self):
     ctx = self._get_ctx()
     with patch(PATCH_PREFIX + 'LambdaBase'):
         fun = permission.LambdaPermission(ctx)
         fun.logger = MagicMock()
         fun.resource_id = ''
         fake_client = self.make_client_function('add_permission',
                                                 return_value='response')
         fun.client = fake_client
         res_id, _ = fun.create({'StatementId': 'test_id'})
         self.assertEqual(res_id, fun.resource_id)
 def test_class_status(self):
     ctx = self._get_ctx()
     with patch(PATCH_PREFIX + 'LambdaBase'):
         fun = permission.LambdaPermission(ctx)
         with self.assertRaises(NotImplementedError):
             fun.status