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)
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={'Statement': { 'Sid': 'test_id' }}) fun.client = fake_client create_response = fun.create({'StatementId': 'test_id'}) self.assertEqual(create_response['Statement']['Sid'], 'test_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