Fix relaxed body canoncalization & introduce further unit tests for both simple and relaxed mode
This commit is contained in:
1 parent
939c3f8bba
commit
6de4fa79cd
2 files changed
+49
-2
No files matched your search
@@ -53,6 +53,26 @@ class TestSimpleAlgorithmBody(BaseCanonicalizationTest):
|
||||
b'Foo \tbar \r\n',
|
||||
b'Foo \tbar \r\n\r\n')
|
||||
|
||||
def test_adds_crlf(self):
|
||||
self.assertCanonicalForm(
|
||||
b'Foo bar\r\n',
|
||||
b'Foo bar')
|
||||
|
||||
def test_empty_body(self):
|
||||
self.assertCanonicalForm(
|
||||
b'\r\n',
|
||||
b'')
|
||||
|
||||
def test_single_crlf_body(self):
|
||||
self.assertCanonicalForm(
|
||||
b'\r\n',
|
||||
b'\r\n')
|
||||
|
||||
def test_multiple_crlf_body(self):
|
||||
self.assertCanonicalForm(
|
||||
b'\r\n',
|
||||
b'\r\n\r\n')
|
||||
|
||||
|
||||
class TestRelaxedAlgorithmHeaders(BaseCanonicalizationTest):
|
||||
|
||||
@@ -98,6 +118,26 @@ class TestRelaxedAlgorithmBody(BaseCanonicalizationTest):
|
||||
b'Foo\r\nbar\r\n',
|
||||
b'Foo\r\nbar\r\n\r\n\r\n')
|
||||
|
||||
def test_adds_crlf(self):
|
||||
self.assertCanonicalForm(
|
||||
b'Foo bar\r\n',
|
||||
b'Foo bar')
|
||||
|
||||
def test_empty_body(self):
|
||||
self.assertCanonicalForm(
|
||||
b'',
|
||||
b'')
|
||||
|
||||
def test_single_crlf_body(self):
|
||||
self.assertCanonicalForm(
|
||||
b'',
|
||||
b'\r\n')
|
||||
|
||||
def test_multiple_crlf_body(self):
|
||||
self.assertCanonicalForm(
|
||||
b'',
|
||||
b'\r\n\r\n')
|
||||
|
||||
|
||||
class TestCanonicalizationPolicyFromCValue(unittest.TestCase):
|
||||
|
||||
|
||||
Reference in new issue
Block a user