# Test to make sure copy works. import unittest from Strobe.Strobe import Strobe class TestCopy(unittest.TestCase): def test_copy(self): a = Strobe(b'foo') b = Strobe(b'foo') msg = a.send_enc(b'atest') self.assertEqual(b'atest', b.recv_enc(msg)) c = b.copy() msg = a.send_enc(b'anothertest') # that both the original and copy work self.assertEqual(b'anothertest', b.recv_enc(msg)) self.assertEqual(b'anothertest', c.recv_enc(msg))