Skip to content
Snippets Groups Projects
Commit afaf778b authored by Kien Le's avatar Kien Le
Browse files

Add test for MSeed.check_q330_gps_status_format

parent 9579d16d
No related branches found
No related tags found
No related merge requests found
import unittest
from sohstationviewer.model.mseed.mseed import MSeed
class TestCheckQ330GPSStatusFormat(unittest.TestCase):
def setUp(self) -> None:
self.gps_status_lines = [
'GPS Status',
'Time: 18:28:49',
'Date: 27/08/2018',
'Fix Type: 3-D',
'Height: 47.6M',
'Latitude: 5906.7572N',
'Longitude: 15651.4038W',
'On Time: 15min',
'Sat. Used: 6',
'In View: 11',
'Checksum Errors: 0',
'Last GPS timemark: 2018-08-27 18:28:48',
'PLL Status'
]
def test_gps_status_not_followed_by_pll_status(self):
self.gps_status_lines[12] = ''
with self.assertRaises(ValueError):
MSeed.check_q330_gps_status_format(self.gps_status_lines)
def test_good_data(self):
try:
MSeed.check_q330_gps_status_format(self.gps_status_lines)
except ValueError:
self.fail()
def test_fix_type_bad_data(self):
self.gps_status_lines[3] = ''
with self.assertRaises(ValueError):
MSeed.check_q330_gps_status_format(self.gps_status_lines)
def test_height_bad_data(self):
self.gps_status_lines[4] = ''
with self.assertRaises(ValueError):
MSeed.check_q330_gps_status_format(self.gps_status_lines)
def test_latitude_bad_data(self):
self.gps_status_lines[5] = ''
with self.assertRaises(ValueError):
MSeed.check_q330_gps_status_format(self.gps_status_lines)
def test_longitude_bad_data(self):
self.gps_status_lines[6] = ''
with self.assertRaises(ValueError):
MSeed.check_q330_gps_status_format(self.gps_status_lines)
def test_sat_used_bad_data(self):
self.gps_status_lines[8] = ''
with self.assertRaises(ValueError):
MSeed.check_q330_gps_status_format(self.gps_status_lines)
def test_gps_timemark_bad_data(self):
self.gps_status_lines[11] = ''
with self.assertRaises(ValueError):
MSeed.check_q330_gps_status_format(self.gps_status_lines)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment