def test_0203_send_receive_timeout(self): """Test that a timeout is triggered when no packet is received.""" udp = bof.UDP() udp.connect("localhost", 13672) with (self.assertRaises(bof.BOFNetworkError)): result, _ = udp.send_receive("test_send_receive", timeout=0.1) udp.disconnect()
def setUpClass(self): self.udp = bof.UDP() self.echo_server = Popen(UDP_ECHO_SERVER_CMD.split())
def test_0104_udp_connect_bad_port(self): """Test error handling for bad port.""" udp = bof.UDP() with self.assertRaises(bof.BOFNetworkError): udp.connect("localhost", 666666)
def test_0103_udp_connect_bad_addr(self): """Test error handling for bad address.""" udp = bof.UDP() with self.assertRaises(bof.BOFNetworkError): udp.connect("invalid", 13671)
def test_0102_udp_connect(self): """Test regular UDP connection.""" udp = bof.UDP() udp.connect("localhost", 13671) self.assertEqual(udp.source[0], '127.0.0.1') udp.disconnect()
def test_0101_udp_instantiate(self): """Test correct BOF UDP object instantiation.""" udp = bof.UDP()
def setUpClass(self): self.udp = bof.UDP()