Ejemplo n.º 1
0
 def test_randomises(self):
     self.assertNotEqual(make_dhcp_transaction_id(),
                         make_dhcp_transaction_id())
Ejemplo n.º 2
0
 def test_init_sets_transaction_id(self):
     transaction_id = make_dhcp_transaction_id()
     self.patch(detect_module,
                "make_dhcp_transaction_id").return_value = transaction_id
     discover = DHCPDiscoverPacket(factory.make_mac_address())
     self.assertEqual(transaction_id, discover.transaction_id)
Ejemplo n.º 3
0
 def test_produces_well_formed_id(self):
     # The DHCP transaction ID should be 4 bytes long.
     transaction_id = make_dhcp_transaction_id()
     self.assertIsInstance(transaction_id, bytes)
     self.assertEqual(4, len(transaction_id))