# Path: tests/kiss_mock.py
# class KissMock(apex.kiss.Kiss):
# 
#     def __init__(self,
#                  strip_df_start=True):
#         super(KissMock, self).__init__(strip_df_start)
#         self.read_from_interface = []
#         self.sent_to_interface = []
# 
#     def _read_interface(self):
#         if not len(self.read_from_interface):
#             return None
#         raw_frame = self.read_from_interface[0]
#         del self.read_from_interface[0]
#         return raw_frame
# 
#     def _write_interface(self, data):
#         self.sent_to_interface.append(data)
# 
#     def clear_interface(self):
#         self.read_from_interface = []
#         self.sent_to_interface = []
# 
#     def add_read_from_interface(self, raw_frame):
#         self.read_from_interface.append(raw_frame)
# 
#     def get_sent_to_interface(self):
#         return self.sent_to_interface


import unittest
import six
import apex.aprs.constants
import apex.aprs.igate
    import httpretty
from .kiss_mock import KissMock
            'source': 'W2GMD-1',
            'destination': 'OMG',
            'path': ['WIDE1-1', 'WIDE2-2'],
            'text': 'test_encode_frame'
        }
ENCODED_FRAME_KISS = [192, 0, 158, 154, 142, 64, 64, 64, 96, 174, 100, 142, 154, 136, 64, 98, 174, 146, 136, 138, 98,
                      64, 98, 174, 146, 136, 138, 100, 64, 101, 3, 240, 116, 101, 115, 116, 95, 101, 110, 99, 111, 100,
                      101, 95, 102, 114, 97, 109, 101, 192]

DECODED_FRAME_KISS_INVALID = {
            'source': 'KG6WTF',
            'destination': 'S7TSUV',
            'path': ['MTOSO-2', 'WIDE2*' 'qAR', 'KF6FIR-10'],
            'text': '`17El#X-/kg6wtf@gosselinfamily.com'
        }
ENCODED_FRAME_KISS_INVALID = [192, 0, 166, 110, 168, 166, 170, 172, 96, 150, 142, 108, 174, 168, 140, 96, 154, 168, 158,
                          166, 158, 64, 100, 174, 146, 136, 138, 100, 226, 130, 164, 224, 150, 140, 108, 140, 146, 164,
                          117, 3, 240, 96, 49, 55, 69, 108, 35, 88, 45, 47, 107, 103, 54, 119, 116, 102, 64, 103, 111,
                          115, 115, 101, 108, 105, 110, 102, 97, 109, 105, 108, 121, 46, 99, 111, 109, 192]



class AprsTest(unittest.TestCase):  # pylint: disable=R0904
    """Tests for Python APRS-IS Bindings."""

    def setUp(self):  # pylint: disable=C0103
        self.fake_server = 'http://localhost:5567/'
        self.fake_callsign = 'KWN4YGH-5'

    def test_read_frame_kiss(self):

# Path: tests/kiss_mock.py
# class KissMock(apex.kiss.Kiss):
# 
#     def __init__(self,
#                  strip_df_start=True):
#         super(KissMock, self).__init__(strip_df_start)
#         self.read_from_interface = []
#         self.sent_to_interface = []
# 
#     def _read_interface(self):
#         if not len(self.read_from_interface):
#             return None
#         raw_frame = self.read_from_interface[0]
#         del self.read_from_interface[0]
#         return raw_frame
# 
#     def _write_interface(self, data):
#         self.sent_to_interface.append(data)
# 
#     def clear_interface(self):
#         self.read_from_interface = []
#         self.sent_to_interface = []
# 
#     def add_read_from_interface(self, raw_frame):
#         self.read_from_interface.append(raw_frame)
# 
#     def get_sent_to_interface(self):
#         return self.sent_to_interface


# Path: tests/test_aprs.py
import unittest
import six
import apex.aprs.constants
import apex.aprs.igate
    import httpretty
from .kiss_mock import KissMock

            'source': 'W2GMD-1',
            'destination': 'OMG',
            'path': ['WIDE1-1', 'WIDE2-2'],
            'text': 'test_encode_frame'
        }
ENCODED_FRAME_KISS = [192, 0, 158, 154, 142, 64, 64, 64, 96, 174, 100, 142, 154, 136, 64, 98, 174, 146, 136, 138, 98,
                      64, 98, 174, 146, 136, 138, 100, 64, 101, 3, 240, 116, 101, 115, 116, 95, 101, 110, 99, 111, 100,
                      101, 95, 102, 114, 97, 109, 101, 192]

DECODED_FRAME_KISS_INVALID = {
            'source': 'KG6WTF',
            'destination': 'S7TSUV',
            'path': ['MTOSO-2', 'WIDE2*' 'qAR', 'KF6FIR-10'],
            'text': '`17El#X-/kg6wtf@gosselinfamily.com'
        }
ENCODED_FRAME_KISS_INVALID = [192, 0, 166, 110, 168, 166, 170, 172, 96, 150, 142, 108, 174, 168, 140, 96, 154, 168, 158,
                          166, 158, 64, 100, 174, 146, 136, 138, 100, 226, 130, 164, 224, 150, 140, 108, 140, 146, 164,
                          117, 3, 240, 96, 49, 55, 69, 108, 35, 88, 45, 47, 107, 103, 54, 119, 116, 102, 64, 103, 111,
                          115, 115, 101, 108, 105, 110, 102, 97, 109, 105, 108, 121, 46, 99, 111, 109, 192]



class AprsTest(unittest.TestCase):  # pylint: disable=R0904
    """Tests for Python APRS-IS Bindings."""

    def setUp(self):  # pylint: disable=C0103
        self.fake_server = 'http://localhost:5567/'
        self.fake_callsign = 'KWN4YGH-5'

    def test_read_frame_kiss(self):

        kiss_mock = KissMock()