Skip to content

Commit

Permalink
Test ScheduledPacket representation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Renelvon committed Jun 14, 2015
1 parent 0f38952 commit 47d2700
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,28 @@ def test_init_with_retries(self):

timeout_cb.cancel()

def test_repr(self):
rudp_packet = json.dumps(
packet.RUDPPacket(
1,
('123.45.67.89', 12345),
('213.54.76.98', 54321)
).to_json()
)
timeout = 0.7
timeout_cb = reactor.callLater(timeout, lambda: None)
sp = self.spclass(rudp_packet, timeout, timeout_cb, retries=10)

self.assertEqual(
repr(sp),
'ScheduledPacket({0}, {1}, {2}, {3})'.format(
rudp_packet,
timeout,
timeout_cb,
sp.retries
)
)


class TestRUDPConnectionAPI(unittest.TestCase):

Expand Down

0 comments on commit 47d2700

Please sign in to comment.