Add kivy mock network and update setup file

This commit is contained in:
shekhar-cis 2022-08-30 18:25:01 +05:30
parent 12de1fc3f0
commit 71a390b578
Signed by untrusted user: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7
4 changed files with 24 additions and 0 deletions

View File

@ -2,4 +2,6 @@
pip3 install -r kivy-requirements.txt
export INSTALL_TESTS=True
pip3 install .

View File

@ -78,6 +78,9 @@ if __name__ == "__main__":
if sys.version_info[0] == 3:
packages.extend(['pybitmessage.bitmessagekivy', 'pybitmessage.bitmessagekivy.baseclass'])
if os.environ.get('INSTALL_TESTS', False):
packages.append('pybitmessage.mock')
# this will silently accept alternative providers of msgpack
# if they are already installed

View File

@ -7,6 +7,7 @@ from pybitmessage.bitmessagekivy.mpybit import NavigateApp
import multiqueue
from class_addressGenerator import FakeAddressGenerator
from pybitmessage.mock.network import stats, objectracker
def main():

18
src/mock/network.py Normal file
View File

@ -0,0 +1,18 @@
# pylint: disable=too-few-public-methods
"""
Mock Network
"""
class objectracker(object):
"""Mock object tracker"""
missingObjects = {}
class stats(object):
"""Mock network statics"""
@staticmethod
def connectedHostsList():
"""List of all the connected hosts"""
return ()