MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / test_fixture_reader_thread1

Function test_fixture_reader_thread1

tests_python/test_fixtures.py:55–71  ·  view source on GitHub ↗
(_dummy_socket)

Source from the content-addressed store, hash-verified

53
54
55def test_fixture_reader_thread1(_dummy_socket):
56 sock = _dummy_socket
57
58 reader_thread = ReaderThread(sock)
59 reader_thread.start()
60
61 json_part = json.dumps({"key": "val"})
62 json_part = json_part.replace(":", ":\n")
63 msg = json_part
64
65 msg = ("Content-Length: %s\r\n\r\n%s" % (len(msg), msg)).encode("utf-8")
66 # Check that receiving 2 messages at a time we're able to properly deal
67 # with each one.
68 sock.put(msg + msg)
69
70 assert reader_thread.get_next_message("check 1") == json_part
71 assert reader_thread.get_next_message("check 2") == json_part
72
73
74def test_fixture_reader_thread2(_dummy_socket):

Callers

nothing calls this directly

Calls 5

get_next_messageMethod · 0.95
ReaderThreadClass · 0.90
dumpsMethod · 0.80
putMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected