-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REF: Move
ServicePatcher
into its own module
- Loading branch information
1 parent
7364285
commit ebc3726
Showing
9 changed files
with
29 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from unittest.mock import patch | ||
|
||
from octue.cloud.emulators._pub_sub import MockSubscriber, MockSubscription, MockTopic | ||
from octue.utils.patches import MultiPatcher | ||
|
||
|
||
class ServicePatcher(MultiPatcher): | ||
"""A multi-patcher that provides the patches needed to run mock services. | ||
:return None: | ||
""" | ||
|
||
def __init__(self): | ||
super().__init__( | ||
patches=[ | ||
patch("octue.cloud.pub_sub.service.Topic", new=MockTopic), | ||
patch("octue.cloud.pub_sub.service.Subscription", new=MockSubscription), | ||
patch("octue.cloud.pub_sub.events.SubscriberClient", new=MockSubscriber), | ||
patch("google.cloud.pubsub_v1.SubscriberClient", new=MockSubscriber), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters