MCPcopy Index your code
hub / github.com/python/cpython / test_packed

Method test_packed

Lib/test/test_ipaddress.py:157–163  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

155 self.assertInstancesEqual(3232235521, "::c0a8:1")
156
157 def test_packed(self):
158 addr = b'\0'*12 + bytes.fromhex("00000000")
159 self.assertInstancesEqual(addr, "::")
160 addr = b'\0'*12 + bytes.fromhex("c0a80001")
161 self.assertInstancesEqual(addr, "::c0a8:1")
162 addr = bytes.fromhex("c0a80001") + b'\0'*12
163 self.assertInstancesEqual(addr, "c0a8:1::")
164
165 def test_negative_ints_rejected(self):
166 msg = "-1 (< 0) is not permitted as an IPv6 address"

Callers

nothing calls this directly

Calls 1

assertInstancesEqualMethod · 0.80

Tested by

no test coverage detected