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

Method assertBadLength

Lib/test/test_ipaddress.py:137–141  ·  view source on GitHub ↗
(length)

Source from the content-addressed store, hash-verified

135
136 def test_bad_packed_length(self):
137 def assertBadLength(length):
138 addr = b'\0' * length
139 msg = "%r (len %d != 4) is not permitted as an IPv4 address"
140 with self.assertAddressError(re.escape(msg % (addr, length))):
141 self.factory(addr)
142
143 assertBadLength(3)
144 assertBadLength(5)

Callers

nothing calls this directly

Calls 3

assertAddressErrorMethod · 0.80
escapeMethod · 0.80
factoryMethod · 0.45

Tested by

no test coverage detected