LakeFormation: deregister_resource() should handle unknown resources (#7023)
This commit is contained in:
parent
c14df137d5
commit
d3efa2afb9
@ -56,6 +56,8 @@ class LakeFormationBackend(BaseBackend):
|
||||
return self.resources[resource_arn]
|
||||
|
||||
def deregister_resource(self, resource_arn: str) -> None:
|
||||
if resource_arn not in self.resources:
|
||||
raise EntityNotFound
|
||||
del self.resources[resource_arn]
|
||||
|
||||
def register_resource(self, resource_arn: str, role_arn: str) -> None:
|
||||
|
@ -41,6 +41,11 @@ def test_deregister_resource():
|
||||
err = exc.value.response["Error"]
|
||||
assert err["Code"] == "EntityNotFoundException"
|
||||
|
||||
with pytest.raises(ClientError) as exc:
|
||||
client.deregister_resource(ResourceArn="some arn")
|
||||
err = exc.value.response["Error"]
|
||||
assert err["Code"] == "EntityNotFoundException"
|
||||
|
||||
|
||||
@mock_lakeformation
|
||||
def test_list_resources():
|
||||
|
Loading…
Reference in New Issue
Block a user