<s> import pytest <EOL> import pynmea2 <EOL> data = "<STR_LIT>" <EOL> def test_version ( ) : <EOL> version = '<STR_LIT>' <EOL> assert pynmea2 . version == version <EOL> assert pynmea2 . __version__ == version <EOL> def test_sentence ( ) : <EOL> msg = pynmea2 . parse ( data ) <EOL> assert msg . talker == '<STR_LIT>' <EOL> assert msg . sentence_type == '<STR_LIT>' <EOL> assert str ( msg ) == data <EOL> def test_checksum ( ) : <EOL> d = data [ : - <NUM_LIT:2> ] + '<STR_LIT>' <EOL> with pytest . raises ( pynmea2 . ChecksumError ) : <EOL> msg = pynmea2 . parse ( d ) <EOL> def test_attribute ( ) : <EOL> msg = pynmea2 . parse ( data ) <EOL> with pytest . raises ( AttributeError ) : <EOL> msg . foobar <EOL> def test_fail ( ) : <EOL> with pytest . raises ( pynmea2 . ParseError ) : <EOL> pynmea2 . parse ( '<STR_LIT>' ) <EOL> with pytest . raises ( pynmea2 . SentenceTypeError ) : <EOL> pynmea2 . parse ( '<STR_LIT>' ) <EOL> def test_mixin ( ) : <EOL> msg = pynmea2 . parse ( data ) <EOL> assert msg . latitude == - <NUM_LIT> <EOL> assert msg . longitude == <NUM_LIT> <EOL> assert msg . latitude_minutes == <NUM_LIT> <EOL> assert msg . longitude_minutes == <NUM_LIT> <EOL> assert msg . latitude_seconds == <NUM_LIT> <EOL> assert msg . longitude_seconds == <NUM_LIT> <EOL> def test_missing ( ) : <EOL> msg = pynmea2 . parse ( "<STR_LIT>" ) <EOL> assert msg . mag_track == None <EOL> def test_missing_2 ( ) : <EOL> msg = pynmea2 . parse ( '<STR_LIT>' ) <EOL> assert msg . snr_4 == '<STR_LIT>' <EOL> def test_missing_3 ( ) : <EOL> data = '<STR_LIT>' <EOL> msg = pynmea2 . parse ( data ) <EOL> assert None == msg . spd_over_grnd_kmph <EOL> assert msg . render ( ) == data <EOL> def test_missing_4 ( ) : <EOL> data = '<STR_LIT>' <EOL> msg = pynmea2 . parse ( data ) <EOL> assert None == msg . spd_over_grnd_kmph <EOL> assert msg . render ( ) == data <EOL> def test_dollar ( ) : <EOL> data = '<STR_LIT>' <EOL> msg = pynmea2 . parse ( data ) <EOL> assert msg . render ( dollar = False , newline = True ) == data <EOL> def test_whitespace ( ) : <EOL> data = '<STR_LIT>' <EOL> msg = pynmea2 . parse ( data ) <EOL> assert msg . render ( dollar = False ) == data . strip ( ) <EOL> def test_nmea_util ( ) : <EOL> assert pynmea2 . nmea_utils . dm_to_sd ( '<STR_LIT:0>' ) == <NUM_LIT:0.> <EOL> assert pynmea2 . nmea_utils . dm_to_sd ( '<STR_LIT>' ) == <NUM_LIT> <EOL> def test_missing_latlon ( ) : <EOL> data = '<STR_LIT>' <EOL> msg = pynmea2 . parse ( data ) <EOL> print ( msg ) <EOL> assert msg . latitude == <NUM_LIT:0.> <EOL> def test_query ( ) : <EOL> data = '<STR_LIT>' <EOL> msg = pynmea2 . parse ( data ) <EOL> assert isinstance ( msg , pynmea2 . QuerySentence ) <EOL> assert msg . talker == '<STR_LIT>' <EOL> assert msg . listener == '<STR_LIT>' <EOL> assert msg . sentence_type == '<STR_LIT>' <EOL> def test_slash ( ) : <EOL> with pytest . raises ( pynmea2 . nmea . ParseError ) : <EOL> msg = pynmea2 . parse ( '<STR_LIT>' ) <EOL> def test_timestamp ( ) : <EOL> t = pynmea2 . nmea_utils . timestamp ( "<STR_LIT>" ) <EOL> assert t . hour == <NUM_LIT:11> <EOL> assert t . minute == <NUM_LIT> <EOL> assert t . second == <NUM_LIT> <EOL> assert t . microsecond == <NUM_LIT:0> <EOL> assert pynmea2 . nmea_utils . timestamp ( '<STR_LIT>' ) . microsecond == <NUM_LIT> <EOL> assert pynmea2 . nmea_utils . timestamp ( '<STR_LIT>' ) . microsecond == <NUM_LIT> <EOL> assert pynmea2 . nmea_utils . timestamp ( '<STR_LIT>' ) . microsecond == <NUM_LIT> <EOL> assert pynmea2 . nmea_utils . timestamp ( '<STR_LIT>' ) . microsecond == <NUM_LIT> <EOL> assert pynmea2 . nmea_utils . timestamp ( '<STR_LIT>' ) . microsecond == <NUM_LIT> <EOL> assert pynmea2 . nmea_utils . timestamp ( '<STR_LIT>' ) . microsecond == <NUM_LIT> <EOL> assert pynmea2 . nmea_utils . timestamp ( '<STR_LIT>' ) . microsecond == <NUM_LIT> </s>
