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

Method test_negative_ints_rejected

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

Source from the content-addressed store, hash-verified

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"
128 with self.assertAddressError(re.escape(msg)):
129 self.factory(-1)
130
131 def test_large_ints_rejected(self):
132 msg = "%d (>= 2**32) is not permitted as an IPv4 address"

Callers

nothing calls this directly

Calls 3

assertAddressErrorMethod · 0.80
escapeMethod · 0.80
factoryMethod · 0.45

Tested by

no test coverage detected