MCPcopy
hub / github.com/jtesta/ssh-audit / test_mpint1

Method test_mpint1

test/test_buffer.py:110–119  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

108 assert self.wbuf._bitlength(Py26Int(42)) == 6
109
110 def test_mpint1(self):
111 mpint1w = lambda x: self.wbuf().write_mpint1(x).write_flush() # noqa
112 mpint1r = lambda x: self.rbuf(x).read_mpint1() # noqa
113 tc = [(0x0, '00 00'),
114 (0x1234, '00 0d 12 34'),
115 (0x12345, '00 11 01 23 45'),
116 (0xdeadbeef, '00 20 de ad be ef')]
117 for p in tc:
118 assert mpint1w(p[0]) == self._b(p[1])
119 assert mpint1r(self._b(p[1])) == p[0]
120
121 def test_mpint2(self):
122 mpint2w = lambda x: self.wbuf().write_mpint2(x).write_flush() # noqa

Callers

nothing calls this directly

Calls 4

_bMethod · 0.95
write_flushMethod · 0.80
write_mpint1Method · 0.80
read_mpint1Method · 0.80

Tested by

no test coverage detected