FaradayRF / faradayio

FaradayRF TUN/TAP adapter
https://www.faradayrf.com
GNU General Public License v3.0
15 stars 6 forks source link

Fix Unit Test Errors With PR #44 #45

Closed kb1lqc closed 6 years ago

kb1lqc commented 6 years ago

PR #44 brings in the serialtest fixes which changed how the TUN was used. This causes the unit testing to change.

The following Travis CI build shows what failures occur. https://travis-ci.org/FaradayRF/faradayio/builds/346652907?utm_source=github_status&utm_medium=notification

Unit Test Errors

============================= test session starts ==============================
platform linux -- Python 3.5.2, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /home/bryce/Documents/git/faradayio, inifile:
plugins: cov-2.5.1
collected 37 items

tests/test_serial.py .FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF                   [ 89%]
tests/test_tun.py FFFF                                                   [100%]

=================================== FAILURES ===================================
_____________________ test_serialParamaterizedSynchSend[] ______________________

test_input = b''

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a992a128>, msg = b''

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
 test_serialParamaterizedSynchSend[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ] 

test_input = b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98f52b0>
msg = b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
________ test_serialParamaterizedSynchSend[ABCDEFGHIJKLMNOPQRSTUVWXYZ] _________

test_input = b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a992af28>
msg = b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
________ test_serialParamaterizedSynchSend[abcdefghijklmnopqrstuvwxyz] _________

test_input = b'abcdefghijklmnopqrstuvwxyz'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98f2160>
msg = b'abcdefghijklmnopqrstuvwxyz'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
________________ test_serialParamaterizedSynchSend[0123456789] _________________

test_input = b'0123456789'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98d9358>, msg = b'0123456789'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
__________ test_serialParamaterizedSynchSend[0123456789abcdefABCDEF] ___________

test_input = b'0123456789abcdefABCDEF'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98f50b8>
msg = b'0123456789abcdefABCDEF'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
 test_serialParamaterizedSynchSend[0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~   

] 

test_input = b'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a992a128>
msg = b'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
_________________ test_serialParamaterizedSynchSend[01234567] __________________

test_input = b'01234567'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98d93c8>, msg = b'01234567'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
___________________ test_serialParamaterizedSynchSend[\xc0] ____________________

test_input = b'\xc0'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98ef860>, msg = b'\xc0'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
_________________ test_serialParamaterizedSynchSend[\xc0\xc0] __________________

test_input = b'\xc0\xc0'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36ab76f748>, msg = b'\xc0\xc0'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
___________________ test_serialParamaterizedSynchSend[\xdb] ____________________

test_input = b'\xdb'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98f98d0>, msg = b'\xdb'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
_________________ test_serialParamaterizedSynchSend[\xdb\xdb] __________________

test_input = b'\xdb\xdb'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98efa58>, msg = b'\xdb\xdb'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
___________________ test_serialParamaterizedSynchSend[\xdd] ____________________

test_input = b'\xdd'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98d9358>, msg = b'\xdd'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
_________________ test_serialParamaterizedSynchSend[\xdd\xdd] __________________

test_input = b'\xdd\xdd'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98f2978>, msg = b'\xdd\xdd'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
___________________ test_serialParamaterizedSynchSend[\xdc] ____________________

test_input = b'\xdc'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98f5da0>, msg = b'\xdc'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
_________________ test_serialParamaterizedSynchSend[\xdc\xdc] __________________

test_input = b'\xdc\xdc'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a992a9b0>, msg = b'\xdc\xdc'

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

faradayio/faraday.py:51: AttributeError
____________________ test_serialParamaterizedSynchReceive[] ____________________

test_input = b''

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98f5ba8>, length = 2

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
 test_serialParamaterizedSynchReceive[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ] 

test_input = b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98f2518>, length = 54

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
_______ test_serialParamaterizedSynchReceive[ABCDEFGHIJKLMNOPQRSTUVWXYZ] _______

test_input = b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98bd160>, length = 28

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
_______ test_serialParamaterizedSynchReceive[abcdefghijklmnopqrstuvwxyz] _______

test_input = b'abcdefghijklmnopqrstuvwxyz'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98f2978>, length = 28

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
_______________ test_serialParamaterizedSynchReceive[0123456789] _______________

test_input = b'0123456789'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98980b8>, length = 12

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
_________ test_serialParamaterizedSynchReceive[0123456789abcdefABCDEF] _________

test_input = b'0123456789abcdefABCDEF'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a992a128>, length = 24

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
 test_serialParamaterizedSynchReceive[0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~    

] 

test_input = b'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a9898978>, length = 102

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
________________ test_serialParamaterizedSynchReceive[01234567] ________________

test_input = b'01234567'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a988a860>, length = 10

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
__________________ test_serialParamaterizedSynchReceive[\xc0] __________________

test_input = b'\xc0'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98ae630>, length = 4

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
________________ test_serialParamaterizedSynchReceive[\xc0\xc0] ________________

test_input = b'\xc0\xc0'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98bd828>, length = 6

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
__________________ test_serialParamaterizedSynchReceive[\xdb] __________________

test_input = b'\xdb'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a988acc0>, length = 4

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
________________ test_serialParamaterizedSynchReceive[\xdb\xdb] ________________

test_input = b'\xdb\xdb'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98f50b8>, length = 6

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
__________________ test_serialParamaterizedSynchReceive[\xdd] __________________

test_input = b'\xdd'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98892b0>, length = 3

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
________________ test_serialParamaterizedSynchReceive[\xdd\xdd] ________________

test_input = b'\xdd\xdd'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98bdcc0>, length = 4

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
__________________ test_serialParamaterizedSynchReceive[\xdc] __________________

test_input = b'\xdc'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98efb00>, length = 3

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
________________ test_serialParamaterizedSynchReceive[\xdc\xdc] ________________

test_input = b'\xdc\xdc'

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchReceive(test_input):
        """
        Tests a synchronous faradayio receive command with data. This should read
        in data, convert it to slip format, libraryand return the original message
        """

        # Create class object necessary for test
        serialPort = SerialTestClass()
        slip = sliplib.Driver()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = slip.send(test_input)

        # Use serial to send raw transmission with slip protocol
        res = serialPort.serialPort.write(slipMsg)

        # Receive data from Faraday which yields each item it parses from slip
>       for item in faradayRadio.receive(res):

tests/test_serial.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a98ae518>, length = 4

    def receive(self, length):
        """Reads in data from a serial port (length bytes), decodes SLIP packets

            A function which reads from the serial port and then uses the SlipLib
            module to decode the SLIP protocol packets. Each message received
            is added to a receive buffer in SlipLib which is then returned.

            Args:
                length (int): Length to receive with serialPort.read(length)

            Returns:
                bytes: An iterator of the receive buffer

            """

        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Receive data from serial port
>       ret = self._serialPort.read(length)
E       AttributeError: 'SerialTestClass' object has no attribute 'read'

faradayio/faraday.py:75: AttributeError
________________________________ test_tunSetup _________________________________

    def test_tunSetup():
        """Setup a Faraday TUN and check initialized values"""

        # Create a test serial port
        serialPort = SerialTestClass()

        # Create test TUN monitor which sets up a python-pytun TUN device at _TUN
>       faradayTUN = faraday.Monitor(serialPort=serialPort)
E       TypeError: __init__() missing 1 required positional argument: 'isRunning'

tests/test_tun.py:17: TypeError
_________________________________ test_tunSend _________________________________

    def test_tunSend():
        """
        Start a TUN adapter and send a message through it. This tests sending ascii
        over a socket connection through the TUN while using pytun to receive the
        data and check that the IP payload is valid with scapy.
        """
        # Create a test serial port
        serialPort = SerialTestClass()

        # Create test TUN monitor which sets up a python-pytun TUN device at _TUN
>       faradayTUN = faraday.Monitor(serialPort=serialPort)
E       TypeError: __init__() missing 1 required positional argument: 'isRunning'

tests/test_tun.py:36: TypeError
_______________________________ test_tunSlipSend _______________________________

    def test_tunSlipSend():
        """
        Test SLIP data sent over the TUN adapter and serial port.

        Start a TUN adapter and send data over it while a thread runs to receive
        data sent over the tunnel and promptly send it over a serial port which is
        running a serial loopback test. Ensures data at the end of the loopback
        test is valid when received over serial. This test does not cover serial
        to TUN/IP nor IP to TUN data validation.
        """
        # Create a test serial port
        serialPort = SerialTestClass()

        # Configure destination IP:port
        destHost = '10.0.0.2'
        destPort = 9999

        # Start the monitor
>       TUNMonitor = faraday.Monitor(serialPort=serialPort)
E       TypeError: __init__() missing 1 required positional argument: 'isRunning'

tests/test_tun.py:91: TypeError
_______________________________ test_serialToTUN _______________________________

    def test_serialToTUN():
        """
        Test serial port to TUN link. Don't need a serial port but just assume that
        an IP packet was received from the serial port and properly decoded with
        SLIP. Send it to the TUN and verify that the IP:PORT receives the message.
        """
        # Create a test serial port for TUN Monitor class. Won't be used.
        serialPort = SerialTestClass()

        # Configure TUN IP:PORT and IP Packet source IP:PORT parameters for test
        sourceAddress = '10.0.0.2'
        sourcePort = 9998
        destPort = 9999

        # Start a TUN Monitor class
>       TUNMonitor = faraday.Monitor(serialPort=serialPort)
E       TypeError: __init__() missing 1 required positional argument: 'isRunning'

tests/test_tun.py:149: TypeError
===================== 36 failed, 1 passed in 0.88 seconds ======================
kb1lqc commented 6 years ago

The first failure shows a pretty clear clue pointing at the issue.

=================================== FAILURES ===================================
_____________________ test_serialParamaterizedSynchSend[] ______________________

test_input = b''

    @pytest.mark.parametrize("test_input", [
        (b""),
        (bytes(string.ascii_letters, "utf-8")),
        (bytes(string.ascii_uppercase, "utf-8")),
        (bytes(string.ascii_lowercase, "utf-8")),
        (bytes(string.digits, "utf-8")),
        (bytes(string.hexdigits, "utf-8")),
        (bytes(string.printable, "utf-8")),
        (bytes(string.octdigits, "utf-8")),
        (sliplib.slip.END),
        (sliplib.slip.END*2),
        (sliplib.slip.ESC),
        (sliplib.slip.ESC*2),
        (sliplib.slip.ESC_ESC),
        (sliplib.slip.ESC_ESC*2),
        (sliplib.slip.ESC_END),
        (sliplib.slip.ESC_END*2),
    ])
    def test_serialParamaterizedSynchSend(test_input):
        # Create class object necessary for test
        serialPort = SerialTestClass()
        faradayRadio = faraday.Faraday(serialPort)

        # Create slip message to test against
        slipMsg = sliplib.encode(test_input)

        # Send data over Faraday
>       res = faradayRadio.send(test_input)

tests/test_serial.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faradayio.faraday.Faraday object at 0x7f36a992a128>, msg = b''

    def send(self, msg):
        """Encodes data to slip protocol and then sends over serial port

            Uses the SlipLib module to convert the message data into SLIP format.
            The message is then sent over the serial port opened with the instance
            of the Faraday class used when invoking send().

            Args:
                msg (bytes): Bytes format message to send over serial port.

            Returns:
                int: Number of bytes transmitted over the serial port.

            """
        # Create a sliplib Driver
        slipDriver = sliplib.Driver()

        # Package data in slip format
        slipData = slipDriver.send(msg)

        # Send data over serial port
>       res = self._serialPort.write(slipData)
E       AttributeError: 'SerialTestClass' object has no attribute 'write'

This is happening because the faradayRadio = faraday.Faraday(serialPort) in the unit test code is NOT passing a pyserial descriptor. This can be remidied by specifying the SerialTestClass() property self.serialPort when passing into the faradayio functions in a way that mimics using normal pyserial ports.

kb1lqc commented 6 years ago

Serial port errors have been alleviated! Now I'm onto the Threading.Event errors shown below...

============================= test session starts ==============================
platform linux -- Python 3.5.2, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /home/bryce/Documents/git/faradayio, inifile:
plugins: cov-2.5.1
collected 37 items

tests/test_serial.py .................................                   [ 89%]
tests/test_tun.py FFFF                                                   [100%]

=================================== FAILURES ===================================
________________________________ test_tunSetup _________________________________

    def test_tunSetup():
        """Setup a Faraday TUN and check initialized values"""

        # Create a test serial port
        serialPort = SerialTestClass()

        # Create test TUN monitor which sets up a python-pytun TUN device at _TUN
>       faradayTUN = faraday.Monitor(serialPort=serialPort)
E       TypeError: __init__() missing 1 required positional argument: 'isRunning'

tests/test_tun.py:17: TypeError
_________________________________ test_tunSend _________________________________

    def test_tunSend():
        """
        Start a TUN adapter and send a message through it. This tests sending ascii
        over a socket connection through the TUN while using pytun to receive the
        data and check that the IP payload is valid with scapy.
        """
        # Create a test serial port
        serialPort = SerialTestClass()

        # Create test TUN monitor which sets up a python-pytun TUN device at _TUN
>       faradayTUN = faraday.Monitor(serialPort=serialPort)
E       TypeError: __init__() missing 1 required positional argument: 'isRunning'

tests/test_tun.py:36: TypeError
_______________________________ test_tunSlipSend _______________________________

    def test_tunSlipSend():
        """
        Test SLIP data sent over the TUN adapter and serial port.

        Start a TUN adapter and send data over it while a thread runs to receive
        data sent over the tunnel and promptly send it over a serial port which is
        running a serial loopback test. Ensures data at the end of the loopback
        test is valid when received over serial. This test does not cover serial
        to TUN/IP nor IP to TUN data validation.
        """
        # Create a test serial port
        serialPort = SerialTestClass()

        # Configure destination IP:port
        destHost = '10.0.0.2'
        destPort = 9999

        # Start the monitor
>       TUNMonitor = faraday.Monitor(serialPort=serialPort)
E       TypeError: __init__() missing 1 required positional argument: 'isRunning'

tests/test_tun.py:91: TypeError
_______________________________ test_serialToTUN _______________________________

    def test_serialToTUN():
        """
        Test serial port to TUN link. Don't need a serial port but just assume that
        an IP packet was received from the serial port and properly decoded with
        SLIP. Send it to the TUN and verify that the IP:PORT receives the message.
        """
        # Create a test serial port for TUN Monitor class. Won't be used.
        serialPort = SerialTestClass()

        # Configure TUN IP:PORT and IP Packet source IP:PORT parameters for test
        sourceAddress = '10.0.0.2'
        sourcePort = 9998
        destPort = 9999

        # Start a TUN Monitor class
>       TUNMonitor = faraday.Monitor(serialPort=serialPort)
E       TypeError: __init__() missing 1 required positional argument: 'isRunning'

tests/test_tun.py:149: TypeError
===================== 4 failed, 33 passed in 0.45 seconds ======================
kb1lqc commented 6 years ago

This should be easy since in https://github.com/FaradayRF/faradayio/pull/44/commits/771a631a12c67b0655c27c304b6638beadda882c I added the need to pass the isRunning parameter in the Monitor class initialization and removed the need to pass it with the run() function.

kb1lqc commented 6 years ago

Fixed after removing some flake8 errors in https://travis-ci.org/FaradayRF/faradayio/jobs/346672578!

kb1lqc commented 6 years ago

Passing unit tests and linting on Travis CI builds show the problem has been fixed. Will address coverage issues in #39