From f65a59f2c6f860ac1db62cc2ecd4e22d64822a8c Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Sat, 22 Jul 2017 21:39:40 +0300 Subject: [PATCH] update jmdaemon tests for new proto --- jmdaemon/test/test_daemon_protocol.py | 5 ++--- jmdaemon/test/test_message_channel.py | 11 +++-------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/jmdaemon/test/test_daemon_protocol.py b/jmdaemon/test/test_daemon_protocol.py index e3a6537..dd1eea4 100644 --- a/jmdaemon/test/test_daemon_protocol.py +++ b/jmdaemon/test/test_daemon_protocol.py @@ -8,8 +8,7 @@ from jmdaemon.orderbookwatch import OrderbookWatch from jmdaemon.daemon_protocol import JMDaemonServerProtocol from jmdaemon.protocol import (COMMAND_PREFIX, ORDER_KEYS, NICK_HASH_LENGTH, NICK_MAX_ENCODED, JM_VERSION, JOINMARKET_NICK_HEADER) -from jmclient import (load_program_config, get_log, jm_single, get_irc_mchannels, - JMTakerClientProtocolFactory, Taker, AbstractWallet) +from jmclient import (load_program_config, get_log, jm_single, get_irc_mchannels) import os from twisted.python.log import startLogging, err from twisted.python.log import msg as tmsg @@ -206,7 +205,7 @@ class JMDaemonTestServerProtocol(JMDaemonServerProtocol): #None should be returned requesting a cryptobox for an unknown cp assert self.get_crypto_box_from_nick("notrealcp") == None #does nothing yet - self.on_error() + self.on_error("dummy error") @JMRequestOffers.responder def on_JM_REQUEST_OFFERS(self): diff --git a/jmdaemon/test/test_message_channel.py b/jmdaemon/test/test_message_channel.py index b76462d..163c36c 100644 --- a/jmdaemon/test/test_message_channel.py +++ b/jmdaemon/test/test_message_channel.py @@ -9,8 +9,7 @@ from jmdaemon.orderbookwatch import OrderbookWatch from jmdaemon.daemon_protocol import JMDaemonServerProtocol from jmdaemon.protocol import (COMMAND_PREFIX, ORDER_KEYS, NICK_HASH_LENGTH, NICK_MAX_ENCODED, JM_VERSION, JOINMARKET_NICK_HEADER) -from jmclient import (load_program_config, get_log, jm_single, get_irc_mchannels, - JMTakerClientProtocolFactory, Taker, AbstractWallet) +from jmclient import get_log import os from jmbase.commands import * from msgdata import * @@ -161,10 +160,6 @@ def test_setup_mc(): #trigger failure to find nick in privmsg mcc.privmsg(cp1+"XXX", "fill", "0") #trigger check_privmsg decorator - mcc.send_sigs(cp1, ["abc", "def"]) - mcc.send_pubkey(cp1, "testpubkey") - mcc.send_ioauth(cp1, ["abc", "def"], "testpub", "testaddr1", "testaddr2", - "testsig") mcc.send_error(cp1, "errormsg") mcc.push_tx(cp1, "deadbeef") #kill the chan on which the cp is marked active; @@ -181,14 +176,14 @@ def test_setup_mc(): del mcc.active_channels[cp1] #try sending a privmsg again; this time it should just print a warning, #as cp1 is not seen anywhere - mcc.send_sigs(cp1, ["abc", "def"]) + mcc.send_error(cp1, "error") #simulate order cancels (even though we have none) mcc.cancel_orders([0,1,2]) #let cp1 be seen on mc2 without having got into active channels; #note that this is an illegal pubmsg and is ignored for everything *except* #nick_seen (what we need here) dmcs[2].on_pubmsg(cp1, "random") - mcc.send_sigs(cp1, ["abc", "def"]) + mcc.send_error(cp1, "error") #Try using the proper way of setting up privsmgs #first try without box mcc.prepare_privmsg(cp1, "auth", "a b c")