예제 #1
0
 def setUpClass(self):
     self.tcp = bof.TCP()
     self.echo_server = Popen(TCP_ECHO_SERVER_CMD.split())
     sleep(0.5)  # Waiting for TCP handshake
예제 #2
0
 def test_0304_tcp_connect_bad_port(self):
     """Test error handling for bad port."""
     tcp = bof.TCP()
     with self.assertRaises(bof.BOFNetworkError):
         tcp.connect("localhost", 666666)
예제 #3
0
 def test_0302_tcp_connect(self):
     """Test regular TCP connection."""
     tcp = bof.TCP()
     tcp.connect("localhost", 23671)
     self.assertEqual(tcp.source[0], '127.0.0.1')
     tcp.disconnect()
예제 #4
0
 def test_0303_tcp_connect_bad_addr(self):
     """Test error handling for bad address."""
     tcp = bof.TCP()
     with self.assertRaises(bof.BOFNetworkError):
         tcp.connect("invalid", 23671)
예제 #5
0
 def test_0301_tcp_instantiate(self):
     """Test correct BOF TCP object instantiation."""
     tcp = bof.TCP()