예제 #1
0
파일: state.py 프로젝트: rusek/across
 def test_enter_after_cancel(self):
     # There are no writes to chan2, so handshake should never complete
     chan1, chan2 = make_channel_pair()
     conn = Connection(chan1)
     conn.cancel()
     with self.assertRaises(ValueError):
         conn.__enter__()
예제 #2
0
파일: state.py 프로젝트: rusek/across
 def test_enter_when_connect_fails(self):
     conn = Connection(UnconnectableChannel())
     with self.assertRaises(ConnectError):
         conn.__enter__()
     with self.assertRaisesRegex(ValueError, 'Connection is closed'):
         conn.__enter__()