Implement a secure ICS protocol targeting LoRa Node151 microcontroller for controlling irrigation.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

22 lines
457 B

  1. # Test to make sure copy works.
  2. import unittest
  3. from Strobe.Strobe import Strobe
  4. class TestCopy(unittest.TestCase):
  5. def test_copy(self):
  6. a = Strobe(b'foo')
  7. b = Strobe(b'foo')
  8. msg = a.send_enc(b'atest')
  9. self.assertEqual(b'atest', b.recv_enc(msg))
  10. c = b.copy()
  11. msg = a.send_enc(b'anothertest')
  12. # that both the original and copy work
  13. self.assertEqual(b'anothertest', b.recv_enc(msg))
  14. self.assertEqual(b'anothertest', c.recv_enc(msg))