Commit dc3493ed authored by Ralf Schmitt's avatar Ralf Schmitt

test_backdoor.py: test that backdoor closes the connection on SystemExit

parent 10fb2713
......@@ -41,6 +41,15 @@ class Test(greentest.TestCase):
line = conn.makefile().read()
self.assertEqual(line, '')
def test_sys_exit(self):
server = backdoor.BackdoorServer(('127.0.0.1', 0))
server.start()
conn = socket.create_connection(('127.0.0.1', server.server_port))
read_until(conn, '>>> ')
conn.sendall('import sys; sys.exit(0)\r\n')
line = conn.makefile().read()
self.assertEqual(line, '')
if __name__ == '__main__':
greentest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment