MCPcopy Create free account
hub / github.com/pexpect/pexpect / test_socket_with_write

Method test_socket_with_write

tests/test_socket.py:170–182  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

168 self.assertEqual(session.before, b'')
169
170 def test_socket_with_write(self):
171 sock = socket.socket(self.af, socket.SOCK_STREAM)
172 sock.connect((self.host, self.port))
173 session = self.spawn(sock, timeout=10)
174 session.expect(self.prompt1)
175 self.assertEqual(session.before, self.motd)
176 session.write(self.enter)
177 session.expect(self.prompt2)
178 session.write(self.enter)
179 session.expect(self.prompt3)
180 session.write(self.exit)
181 session.expect(pexpect.EOF)
182 self.assertEqual(session.before, b'')
183
184 def test_timeout(self):
185 with self.assertRaises(pexpect.TIMEOUT):

Callers

nothing calls this directly

Calls 3

spawnMethod · 0.95
expectMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected