Tests: style.

This commit is contained in:
Andrei Zeliankou
2020-11-19 05:21:22 +00:00
parent 25219a7ece
commit e154d7a3a2

View File

@@ -154,54 +154,58 @@ Connection: close
def test_http_header_field_leading_sp(self):
self.load('empty')
resp = self.get(
headers={
'Host': 'localhost',
' Custom-Header': 'blah',
'Connection': 'close',
}
)
assert resp['status'] == 400, 'field leading sp'
assert (
self.get(
headers={
'Host': 'localhost',
' Custom-Header': 'blah',
'Connection': 'close',
}
)['status']
== 400
), 'field leading sp'
def test_http_header_field_leading_htab(self):
self.load('empty')
resp = self.get(
headers={
'Host': 'localhost',
'\tCustom-Header': 'blah',
'Connection': 'close',
}
)
assert resp['status'] == 400, 'field leading htab'
assert (
self.get(
headers={
'Host': 'localhost',
'\tCustom-Header': 'blah',
'Connection': 'close',
}
)['status']
== 400
), 'field leading htab'
def test_http_header_field_trailing_sp(self):
self.load('empty')
resp = self.get(
headers={
'Host': 'localhost',
'Custom-Header ': 'blah',
'Connection': 'close',
}
)
assert resp['status'] == 400, 'field trailing sp'
assert (
self.get(
headers={
'Host': 'localhost',
'Custom-Header ': 'blah',
'Connection': 'close',
}
)['status']
== 400
), 'field trailing sp'
def test_http_header_field_trailing_htab(self):
self.load('empty')
resp = self.get(
headers={
'Host': 'localhost',
'Custom-Header\t': 'blah',
'Connection': 'close',
}
)
assert resp['status'] == 400, 'field trailing htab'
assert (
self.get(
headers={
'Host': 'localhost',
'Custom-Header\t': 'blah',
'Connection': 'close',
}
)['status']
== 400
), 'field trailing htab'
def test_http_header_content_length_big(self):
self.load('empty')