MCPcopy Index your code
hub / github.com/davidaurelio/hashids-python / test_decode_hex

Method test_decode_hex

test/test_hashids.py:177–183  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

175 assert h.decode(h.encode(1)[:-1] + '0') == ()
176
177 def test_decode_hex(self):
178 hex_str = '507f1f77bcf86cd799439011'
179 assert Hashids().decode_hex('y42LW46J9luq3Xq9XMly') == hex_str
180 h = Hashids(min_length=1000)
181 assert h.decode_hex(h.encode_hex(hex_str)) == hex_str
182 assert Hashids().decode_hex('WxMLpERDrmh25Lp4L3xEfM6WovWYO3IjkRMKR2ogCMVzn4zQlqt1WK8jKq7OsEpy2qyw1Vi2p') == \
183 'f000000000000000000000000000000000000000000000000000000000000000000000000000000000000f'
184
185 def test_illegal_decode_hex(self):
186 assert Hashids().decode_hex('') == ''

Callers

nothing calls this directly

Calls 3

decode_hexMethod · 0.95
encode_hexMethod · 0.95
HashidsClass · 0.90

Tested by

no test coverage detected