From c8e8b67a1a700256bf9943f8d2e239cd3c9dcb4c Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 17 Jul 2024 12:51:12 +0100 Subject: [PATCH] ENH: Implement `MockSubscription.delete` --- octue/cloud/emulators/_pub_sub.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/octue/cloud/emulators/_pub_sub.py b/octue/cloud/emulators/_pub_sub.py index 091a66a5f..219db40fd 100644 --- a/octue/cloud/emulators/_pub_sub.py +++ b/octue/cloud/emulators/_pub_sub.py @@ -82,11 +82,14 @@ def create(self, allow_existing=False): self._created = True def delete(self): - """Do nothing. + """Delete the subscription from the global subscriptions dictionary. :return None: """ - pass + try: + SUBSCRIPTIONS.remove(self.name) + except KeyError: + pass def exists(self, timeout=5): """Check if the subscription exists in the global subscriptions dictionary.