Commit fabdaa4e authored by André's avatar André

Test: Use Mock from standard library

parent 633e0dd2
......@@ -18,7 +18,6 @@ class TestDispatcherNB(unittest.TestCase):
# Setup mock client
self.client = Mock()
self.client._caller = Mock()
self.client.defaultNamespace = protocol.NS_CLIENT
self.client.Connection = Mock() # mock transport
self.con = self.client.Connection
......
This diff is collapsed.
......@@ -4,7 +4,7 @@ Module with dummy classes for unit testing of XMPP and related code.
import threading, time
from test.lib.mock import Mock
from unittest.mock import Mock
from nbxmpp import idlequeue
......
......@@ -5,9 +5,10 @@ It actually connects to a xmpp server.
'''
import unittest
from unittest.mock import Mock
from test.lib.xmpp_mocks import MockConnection, IdleQueueThread
from test.lib.mock import Mock
from nbxmpp import client_nb
# (XMPP server hostname, c2s port). Script will connect to the machine.
......@@ -56,7 +57,7 @@ class TestNonBlockingClient(unittest.TestCase):
self.client = client_nb.NonBlockingClient(
domain=server_port[0],
idlequeue=self.idlequeue_thread.iq,
caller=Mock(realClass=TempConnection))
caller=Mock(spec=TempConnection))
self.client.connect(
hostname=server_port[0],
......
......@@ -19,7 +19,6 @@ class TestDispatcherNB(unittest.TestCase):
# Setup mock client
self.client = Mock()
self.client._caller = Mock()
self.client.defaultNamespace = protocol.NS_CLIENT
self.client.Connection = Mock() # mock transport
self.con = self.client.Connection
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment