Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions chains/links/transport_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Local imports
from chains.links import link
from chains.utils import file_utils, log_utils, data_utils
from chains.utils import data_utils, file_utils


class TransportMeta(link.Link):
Expand Down Expand Up @@ -39,7 +39,8 @@ def transport_meta_data(self):
@staticmethod
def _get_transport_type(transport):
"""Give the transport as a string or None if not one"""
return transport.__class__.__name__ if transport.__class__.__name__ != 'str' else None
transport_type = transport.__class__.__name__
return transport_type if transport_type not in ('str', 'bytes', 'bytearray') else None

@staticmethod
def _readable_flags(transport):
Expand Down Expand Up @@ -70,6 +71,7 @@ def _readable_flags(transport):
_flag_list.append('psh')
return _flag_list


def test():
"""Test for TransportMeta class"""
import pprint
Expand All @@ -94,5 +96,6 @@ def test():
for item in tmeta.output_stream:
pprint.pprint(item)


if __name__ == '__main__':
test()