Skip to content

Commit

Permalink
Stricten mocks used in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Renelvon committed Jun 5, 2015
1 parent b64f1e3 commit 506d359
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_rudp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from twisted.internet import protocol
from twisted.test import proto_helpers

from txrudp import heap, packet, rudp
from txrudp import connection, heap, packet, rudp


class TestConnectionManagerAPI(unittest.TestCase):
Expand All @@ -16,7 +16,7 @@ def setUpClass(cls):
cls.addr = (cls.public_ip, cls.port)

def _make_cm_with_mocks(self):
cf = mock.Mock()
cf = mock.Mock(spec_set=connection.RUDPConnectionFactory)
return rudp.ConnectionMultiplexer(cf, self.public_ip)

def test_default_init(self):
Expand Down Expand Up @@ -54,10 +54,10 @@ def test_get_nonexistent_connection(self):

def test_set_and_get_new_connection(self):
cm = self._make_cm_with_mocks()
mock_connection = mock.Mock()
mock_connection = mock.Mock(spec_set=connection.RUDPConnection)
cm[self.addr] = mock_connection
self.assertIn(self.addr, cm)
self.assertEqual(cm[self.addr], mock_connection)
self.assertIs(cm[self.addr], mock_connection)

def test_set_existent_connection(self):
pass

0 comments on commit 506d359

Please sign in to comment.