# Path: ogn/parser/aprs_comment/inreach_parser.py
# class InreachParser(BaseParser):
#     def __init__(self):
#         self.beacon_type = 'inreach'
#         self.position_pattern = PATTERN_INREACH_POSITION_COMMENT
# 
#     def parse_position(self, aprs_comment):
#         match = self.position_pattern.match(aprs_comment)
#         return {'address': match.group('id'),
#                 'model': match.group('model') if match.group('model') else None,
#                 'status': match.group('status') == 'True' if match.group('status') else None,
#                 'pilot_name': match.group('pilot_name') if match.group('pilot_name') else None}


import unittest
from ogn.parser.aprs_comment.inreach_parser import InreachParser


class TestStringMethods(unittest.TestCase):
    def test_position_comment(self):
        message = InreachParser().parse_position("id300434060496190 inReac True")
        self.assertEqual(message['address'], "300434060496190")
        self.assertEqual(message['model'], 'inReac')
        self.assertEqual(message['status'], True)
        self.assertEqual(message['pilot_name'], None)


# Path: ogn/parser/aprs_comment/inreach_parser.py
# class InreachParser(BaseParser):
#     def __init__(self):
#         self.beacon_type = 'inreach'
#         self.position_pattern = PATTERN_INREACH_POSITION_COMMENT
# 
#     def parse_position(self, aprs_comment):
#         match = self.position_pattern.match(aprs_comment)
#         return {'address': match.group('id'),
#                 'model': match.group('model') if match.group('model') else None,
#                 'status': match.group('status') == 'True' if match.group('status') else None,
#                 'pilot_name': match.group('pilot_name') if match.group('pilot_name') else None}


# Path: tests/parser/test_parse_inreach.py
import unittest
from ogn.parser.aprs_comment.inreach_parser import InreachParser



class TestStringMethods(unittest.TestCase):
    def test_position_comment(self):
        message = InreachParser().parse_position("id300434060496190 inReac True")
        self.assertEqual(message['address'], "300434060496190")
        self.assertEqual(message['model'], 'inReac')
        self.assertEqual(message['status'], True)
        self.assertEqual(message['pilot_name'], None)


        message = InreachParser().parse_position("id300434060496190 inReac True Jim Bob")