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

Method test_packed

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

Source from the content-addressed store, hash-verified

120 self.assertInstancesEqual(3232235521, "192.168.0.1")
121
122 def test_packed(self):
123 self.assertInstancesEqual(bytes.fromhex("00000000"), "0.0.0.0")
124 self.assertInstancesEqual(bytes.fromhex("c0a80001"), "192.168.0.1")
125
126 def test_negative_ints_rejected(self):
127 msg = "-1 (< 0) is not permitted as an IPv4 address"

Callers

nothing calls this directly

Calls 1

assertInstancesEqualMethod · 0.80

Tested by

no test coverage detected