Skip to content
Snippets Groups Projects
Commit 355135f3 authored by inso's avatar inso
Browse files

Pass tests

parent 8e955933
No related branches found
No related tags found
No related merge requests found
......@@ -299,7 +299,7 @@ class Account(QObject):
error = 0
replies = yield from community.bma_access.broadcast(bma.wot.Add, {}, {'pubkey': self.pubkey,
'self_': selfcert.signed_raw(),
'other': ""})
'other': {}})
except ValueError as e:
error += 1
error_msg = str(e)
......
......@@ -86,9 +86,10 @@ class ProcessAddCommunity(unittest.TestCase):
self.assertEqual(mock.get_request(i).method, 'GET')
self.assertEqual(mock.get_request(i).url,
'/wot/lookup/7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ')
yield from asyncio.sleep(1)
self.assertEqual(mock.get_request(6).method, 'POST')
self.assertEqual(mock.get_request(6).url[:8], '/wot/add')
self.assertEqual(mock.get_request(5).method, 'POST')
self.assertEqual(mock.get_request(5).url[:8], '/wot/add')
self.assertEqual(process_community.label_error.text(), "Broadcasting identity...")
yield from asyncio.sleep(1)
......
......@@ -39,7 +39,7 @@ class TestTransferDialog(unittest.TestCase):
self.endpoint = BMAEndpoint("", "127.0.0.1", "", 50000)
self.node = Node(self.network_manager, "test_currency", [self.endpoint],
"", "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk",
bma.blockchain.Block.null_value, Node.ONLINE,
None, Node.ONLINE,
time.time(), {}, "ucoin", "0.14.0", 0)
self.network = Network.create(self.network_manager, self.node)
self.bma_access = BmaAccess.create(self.network)
......
......@@ -251,6 +251,13 @@ bma_txsources_john = {
}
]}
bma_with_ud = {
"result":
{
"blocks": []
}
}
def get_mock():
mock = HTTPMock('127.0.0.1', 50000)
......@@ -266,6 +273,12 @@ def get_mock():
times=FOREVER,
headers={'Content-Type': 'application/json'})
mock.when('GET /blockchain/with/UD')\
.reply(body=bytes(json.dumps(bma_with_ud), "utf-8"),
status=200,
times=FOREVER,
headers={'Content-Type': 'application/json'})
mock.when('GET /blockchain/current')\
.reply(body=bytes(json.dumps(bma_blockchain_current), "utf-8"),
status=200,
......
......@@ -12,7 +12,7 @@ from ucoinpy.documents.certification import SelfCertification
from cutecoin.tools.exceptions import Error, NoPeerAvailable,\
MembershipNotFoundError
from ucoinpy.api import bma
from cutecoin.core.net.api.bma import PROTOCOL_VERSION
from ucoinpy.api.bma import PROTOCOL_VERSION
from PyQt5.QtCore import QObject, pyqtSignal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment