Skip to content

Commit

Permalink
Remove no longer needed tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonspeed committed Mar 15, 2024
1 parent 4259b3b commit 26645c4
Showing 1 changed file with 0 additions and 63 deletions.
63 changes: 0 additions & 63 deletions src/twisted/web/test/test_http_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,38 +86,6 @@ def test_setRawHeaders(self) -> None:
self.assertTrue(h.hasHeader(b"Test"))
self.assertEqual(h.getRawHeaders(b"test"), rawValue)

def test_rawHeadersTypeCheckingValuesIterable(self) -> None:
"""
L{Headers.setRawHeaders} requires values to be of type list.
"""
h = Headers()
self.assertRaises(TypeError, h.setRawHeaders, b"key", {b"Foo": b"bar"})

def test_rawHeadersTypeCheckingName(self) -> None:
"""
L{Headers.setRawHeaders} requires C{name} to be a L{bytes} or
L{str} string.
"""
h = Headers()
e = self.assertRaises(TypeError, h.setRawHeaders, None, [b"foo"])
self.assertEqual(
e.args[0],
"Header name is an instance of <class 'NoneType'>, " "not bytes or str",
)

def test_rawHeadersTypeCheckingValuesAreString(self) -> None:
"""
L{Headers.setRawHeaders} requires values to a L{list} of L{bytes} or
L{str} strings.
"""
h = Headers()
e = self.assertRaises(TypeError, h.setRawHeaders, b"key", [b"bar", None])
self.assertEqual(
e.args[0],
"Header value at position 1 is an instance of <class 'NoneType'>, "
"not bytes or str",
)

def test_addRawHeader(self) -> None:
"""
L{Headers.addRawHeader} adds a new value for a given header.
Expand All @@ -128,30 +96,6 @@ def test_addRawHeader(self) -> None:
h.addRawHeader(b"test", b"panda")
self.assertEqual(h.getRawHeaders(b"test"), [b"lemur", b"panda"])

def test_addRawHeaderTypeCheckName(self) -> None:
"""
L{Headers.addRawHeader} requires C{name} to be a L{bytes} or L{str}
string.
"""
h = Headers()
e = self.assertRaises(TypeError, h.addRawHeader, None, b"foo")
self.assertEqual(
e.args[0],
"Header name is an instance of <class 'NoneType'>, " "not bytes or str",
)

def test_addRawHeaderTypeCheckValue(self) -> None:
"""
L{Headers.addRawHeader} requires value to be a L{bytes} or L{str}
string.
"""
h = Headers()
e = self.assertRaises(TypeError, h.addRawHeader, b"key", None)
self.assertEqual(
e.args[0],
"Header value is an instance of <class 'NoneType'>, " "not bytes or str",
)

def test_getRawHeadersNoDefault(self) -> None:
"""
L{Headers.getRawHeaders} returns L{None} if the header is not found and
Expand Down Expand Up @@ -435,13 +379,6 @@ def test_rawHeadersValueEncoding(self) -> None:
self.assertTrue(h.hasHeader(b"\xe1"))
self.assertEqual(h.getRawHeaders(b"\xe1"), [b"\xe2\x98\x83", b"foo"])

def test_rawHeadersTypeChecking(self) -> None:
"""
L{Headers.setRawHeaders} requires values to be of type sequence
"""
h = Headers()
self.assertRaises(TypeError, h.setRawHeaders, "key", {"Foo": "bar"})

def test_addRawHeader(self) -> None:
"""
L{Headers.addRawHeader} adds a new value for a given header.
Expand Down

0 comments on commit 26645c4

Please sign in to comment.