added mocks for testing
This commit is contained in:
parent
50bf465add
commit
b068c9144a
0
components/shared/dse_shared_libs/mock/__init__.py
Normal file
0
components/shared/dse_shared_libs/mock/__init__.py
Normal file
11
components/shared/dse_shared_libs/mock/datetime.py
Normal file
11
components/shared/dse_shared_libs/mock/datetime.py
Normal file
@ -0,0 +1,11 @@
|
||||
class MyDate:
|
||||
timestamp = None
|
||||
|
||||
@classmethod
|
||||
def set_timestamp(cls, timestamp):
|
||||
cls.timestamp = timestamp
|
||||
|
||||
@classmethod
|
||||
def now(cls):
|
||||
return cls.timestamp
|
||||
|
||||
43
components/shared/dse_shared_libs/mock/rabbit_mq_mocks.py
Normal file
43
components/shared/dse_shared_libs/mock/rabbit_mq_mocks.py
Normal file
@ -0,0 +1,43 @@
|
||||
class MyQueue:
|
||||
@property
|
||||
def queue(self):
|
||||
return None
|
||||
|
||||
|
||||
class MyMethod:
|
||||
method = MyQueue()
|
||||
|
||||
|
||||
class MyChannel:
|
||||
@staticmethod
|
||||
def exchange_declare(*args, **kwargs):
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def queue_declare(*args, **kwargs):
|
||||
return MyMethod
|
||||
|
||||
@staticmethod
|
||||
def queue_bind(*args, **kwargs):
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def basic_consume(*args, **kwargs):
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def basic_publish(*args, **kwargs):
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def start_consuming(*args, **kwargs):
|
||||
return None
|
||||
|
||||
|
||||
class MyBlockingConnection:
|
||||
def __init__(self, *args, **kwargs):
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def channel():
|
||||
return MyChannel()
|
||||
Loading…
x
Reference in New Issue
Block a user