mock real behaviour

This commit is contained in:
Torma Kristóf 2020-03-29 18:26:19 +02:00
parent 459806683a
commit ef47d7d6d3
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
import random
import requests import requests
from singleton import Singleton from singleton import Singleton
@ -23,21 +24,21 @@ class Communicator(Singleton):
:param message: :param message:
:return: none :return: none
""" """
pass return None
def discoveravailableconsumers(self) -> list: def discoveravailableconsumers(self) -> list:
""" """
Get the list of available consumer from the current primary consumer. Get the list of available consumer from the current primary consumer.
:return: :return:
""" """
pass return ["10.69.42.1","10.42.69.1","10.10.10.10","10.6.66.1"]
def isconsumeravailable(self) -> bool: def isconsumeravailable(self) -> bool:
""" """
Readiness probe primary consumer. Readiness probe primary consumer.
:return: :return:
""" """
pass return bool(random.getrandbits(1))
def checkconsumer(self, consumer: str) -> bool: def checkconsumer(self, consumer: str) -> bool:
""" """
@ -45,4 +46,4 @@ class Communicator(Singleton):
:param consumer: :param consumer:
:return: :return:
""" """
pass return bool(random.getrandbits(1))