Skip to content

Commit

Permalink
Merge branch 'trunk' into 9438-py2-bytes-directory-listing
Browse files Browse the repository at this point in the history
  • Loading branch information
markrwilliams authored May 7, 2018
2 parents a672a91 + 7ae6531 commit 688f779
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/twisted/internet/test/test_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from twisted.internet.error import (
ConnectionLost, UserError, ConnectionRefusedError, ConnectionDone,
ConnectionAborted, DNSLookupError, NoProtocol,
ConnectBindError,
ConnectBindError, ConnectionClosed,
)
from twisted.internet.test.connectionmixins import (
LogObserverMixin, ConnectionTestsMixin, StreamClientTestsMixin,
Expand Down Expand Up @@ -1266,7 +1266,7 @@ def stopReactorAndCloseFileDescriptors(result):
testCase.assertNoResult(clientFactory.failDeferred)
testCase.successResultOf(clientFactory.deferred)
testCase.assertRaises(
testCase.lostConnectionReason,
ConnectionClosed,
clientFactory.lostReason.raiseException,
)

Expand Down Expand Up @@ -1357,7 +1357,6 @@ class StreamTransportTestsMixin(LogObserverMixin):
"""
Mixin defining tests which apply to any port/connection based transport.
"""
lostConnectionReason = ConnectionDone

def test_startedListeningLogMessage(self):
"""
Expand Down
Empty file.
Empty file.
8 changes: 8 additions & 0 deletions src/twisted/web/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ class Data(resource.Resource):
"""

def __init__(self, data, type):
"""
@param data: The bytes that make up this data resource.
@type data: L{bytes}
@param type: A native string giving the Internet media type for this
content.
@type type: L{str}
"""
resource.Resource.__init__(self)
self.data = data
self.type = type
Expand Down

0 comments on commit 688f779

Please sign in to comment.