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

Method assertBadLength

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

Source from the content-addressed store, hash-verified

174
175 def test_bad_packed_length(self):
176 def assertBadLength(length):
177 addr = b'\0' * length
178 msg = "%r (len %d != 16) is not permitted as an IPv6 address"
179 with self.assertAddressError(re.escape(msg % (addr, length))):
180 self.factory(addr)
181 self.factory(addr)
182
183 assertBadLength(15)
184 assertBadLength(17)

Callers

nothing calls this directly

Calls 3

assertAddressErrorMethod · 0.80
escapeMethod · 0.80
factoryMethod · 0.45

Tested by

no test coverage detected