Tests: style.
This commit is contained in:
@@ -154,54 +154,58 @@ Connection: close
|
|||||||
def test_http_header_field_leading_sp(self):
|
def test_http_header_field_leading_sp(self):
|
||||||
self.load('empty')
|
self.load('empty')
|
||||||
|
|
||||||
resp = self.get(
|
assert (
|
||||||
|
self.get(
|
||||||
headers={
|
headers={
|
||||||
'Host': 'localhost',
|
'Host': 'localhost',
|
||||||
' Custom-Header': 'blah',
|
' Custom-Header': 'blah',
|
||||||
'Connection': 'close',
|
'Connection': 'close',
|
||||||
}
|
}
|
||||||
)
|
)['status']
|
||||||
|
== 400
|
||||||
assert resp['status'] == 400, 'field leading sp'
|
), 'field leading sp'
|
||||||
|
|
||||||
def test_http_header_field_leading_htab(self):
|
def test_http_header_field_leading_htab(self):
|
||||||
self.load('empty')
|
self.load('empty')
|
||||||
|
|
||||||
resp = self.get(
|
assert (
|
||||||
|
self.get(
|
||||||
headers={
|
headers={
|
||||||
'Host': 'localhost',
|
'Host': 'localhost',
|
||||||
'\tCustom-Header': 'blah',
|
'\tCustom-Header': 'blah',
|
||||||
'Connection': 'close',
|
'Connection': 'close',
|
||||||
}
|
}
|
||||||
)
|
)['status']
|
||||||
|
== 400
|
||||||
assert resp['status'] == 400, 'field leading htab'
|
), 'field leading htab'
|
||||||
|
|
||||||
def test_http_header_field_trailing_sp(self):
|
def test_http_header_field_trailing_sp(self):
|
||||||
self.load('empty')
|
self.load('empty')
|
||||||
|
|
||||||
resp = self.get(
|
assert (
|
||||||
|
self.get(
|
||||||
headers={
|
headers={
|
||||||
'Host': 'localhost',
|
'Host': 'localhost',
|
||||||
'Custom-Header ': 'blah',
|
'Custom-Header ': 'blah',
|
||||||
'Connection': 'close',
|
'Connection': 'close',
|
||||||
}
|
}
|
||||||
)
|
)['status']
|
||||||
|
== 400
|
||||||
assert resp['status'] == 400, 'field trailing sp'
|
), 'field trailing sp'
|
||||||
|
|
||||||
def test_http_header_field_trailing_htab(self):
|
def test_http_header_field_trailing_htab(self):
|
||||||
self.load('empty')
|
self.load('empty')
|
||||||
|
|
||||||
resp = self.get(
|
assert (
|
||||||
|
self.get(
|
||||||
headers={
|
headers={
|
||||||
'Host': 'localhost',
|
'Host': 'localhost',
|
||||||
'Custom-Header\t': 'blah',
|
'Custom-Header\t': 'blah',
|
||||||
'Connection': 'close',
|
'Connection': 'close',
|
||||||
}
|
}
|
||||||
)
|
)['status']
|
||||||
|
== 400
|
||||||
assert resp['status'] == 400, 'field trailing htab'
|
), 'field trailing htab'
|
||||||
|
|
||||||
def test_http_header_content_length_big(self):
|
def test_http_header_content_length_big(self):
|
||||||
self.load('empty')
|
self.load('empty')
|
||||||
|
|||||||
Reference in New Issue
Block a user