MCPcopy Create free account
hub / github.com/apache/qpid-proton / test_client_server

Method test_client_server

python/examples/test_examples.py:81–93  ·  view source on GitHub ↗
(self, client=['client.py'], server=['server.py'], sleep=0)

Source from the content-addressed store, hash-verified

79 self.assertEqual(actual, expected)
80
81 def test_client_server(self, client=['client.py'], server=['server.py'], sleep=0):
82 with Popen(server) as s:
83 if sleep:
84 time.sleep(sleep)
85 with run(client) as c:
86 s.terminate()
87 actual = [line.strip() for line in c.stdout]
88 inputs = ["Twas brillig, and the slithy toves",
89 "Did gire and gymble in the wabe.",
90 "All mimsy were the borogroves,",
91 "And the mome raths outgrabe."]
92 expected = ["%s => %s" % (line, line.upper()) for line in inputs]
93 self.assertEqual(actual, expected)
94
95 def test_sync_client_server(self):
96 self.test_client_server(client=['sync_client.py'])

Calls 5

sleepMethod · 0.80
terminateMethod · 0.80
assertEqualMethod · 0.80
PopenClass · 0.70
runFunction · 0.70

Tested by

no test coverage detected