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

Class ContentLengthChecker

Lib/test/test_httplib.py:169–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167 def test_content_length_0(self):
168
169 class ContentLengthChecker(list):
170 def __init__(self):
171 list.__init__(self)
172 self.content_length = None
173 def append(self, item):
174 kv = item.split(b':', 1)
175 if len(kv) > 1 and kv[0].lower() == b'content-length':
176 self.content_length = kv[1].strip()
177 list.append(self, item)
178
179 # Here, we're testing that methods expecting a body get a
180 # content-length set to zero if the body is empty (either None or '')

Callers 1

test_content_length_0Method · 0.85

Calls

no outgoing calls

Tested by 1

test_content_length_0Method · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…