comparison tests/test-wireproto.py @ 37633:33a6eee08db2

wireproto: remove iterbatch() from peer interface (API) Good riddance. Some tests have been ported to the new API. This probably should have been done in earlier commits. But duplicating the test coverage would have been difficult. It was easier this way. .. api:: The wire protocol peer's ``iterbatch()`` for bulk executing commands has been remove.d Use ``peer.commandexecutor()`` instead. Differential Revision: https://phab.mercurial-scm.org/D3271
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 11 Apr 2018 16:18:26 -0700
parents a81d02ea65db
children b4d85bc122bd
comparison
equal deleted inserted replaced
37632:6c55ce51d6c3 37633:33a6eee08db2
91 91
92 srv = serverrepo() 92 srv = serverrepo()
93 clt = clientpeer(srv, uimod.ui()) 93 clt = clientpeer(srv, uimod.ui())
94 94
95 print(clt.greet(b"Foobar")) 95 print(clt.greet(b"Foobar"))
96 b = clt.iterbatch() 96
97 list(map(b.greet, (b'Fo, =;:<o', b'Bar'))) 97 with clt.commandexecutor() as e:
98 b.submit() 98 fgreet1 = e.callcommand(b'greet', {b'name': b'Fo, =;:<o'})
99 print([r for r in b.results()]) 99 fgreet2 = e.callcommand(b'greet', {b'name': b'Bar'})
100
101 print([f.result() for f in (fgreet1, fgreet2)])