Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOHViewer
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Public
PASSOFT
SOHViewer
Commits
afaf778b
Commit
afaf778b
authored
2 years ago
by
Kien Le
Browse files
Options
Downloads
Patches
Plain Diff
Add test for MSeed.check_q330_gps_status_format
parent
9579d16d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_model/test_mseed.py
+63
-0
63 additions, 0 deletions
tests/test_model/test_mseed.py
with
63 additions
and
0 deletions
tests/test_model/test_mseed.py
0 → 100644
+
63
−
0
View file @
afaf778b
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment