Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomag-algorithms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
ghsc
National Geomagnetism Program
geomag-algorithms
Commits
db76fc31
Commit
db76fc31
authored
4 years ago
by
Cain, Payton David
Browse files
Options
Downloads
Patches
Plain Diff
Add STJ packet/write test
parent
4a752cc2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!146
Release CMO metadata to production
,
!34
Update bitwise calculation for GOES header
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/imfv283_test/IMFV283Parser_test.py
+34
-11
34 additions, 11 deletions
test/imfv283_test/IMFV283Parser_test.py
with
34 additions
and
11 deletions
test/imfv283_test/IMFV283Parser_test.py
+
34
−
11
View file @
db76fc31
...
...
@@ -21,7 +21,7 @@ IMFV283_EXAMPLE_FRD = (
+
b
"
@cVAjT@[CAVW@cWAjT@[CAVT@cWAjU@[AAVO@cYAjV@Z}AVK@c[AjV
"
)
IMFV283_EXAMPLE_S
J
T
=
(
IMFV283_EXAMPLE_ST
J
=
(
b
"
75C1E7AC20259002641G44-3NN027EXE00191`@OA@BWGbx{
"
+
b
"
x@@Bh
\x7f
D`@@@@@@@@@@@@@@@@@@@@@@@@@@@FDODdV}X_yxAGHODlV~L_z|AG
"
+
b
"
tODPV
\x7f
@_{pAxLOC`V
\x7f
p_|pAxPOBdV@D`}dAxdOAxVAX`~lAx`O@|VAp`
\x7f
XAyDO@tVCd`@
\\
Bx`O
\x7f
XUC|`APByDO
\x7f
dUEd`AtBx`O~
\\
UEp`BXBGtO}PUFP`CHB
\n
75C1E7AC20259001441G44-3NN027EXE00191`@LA@BWGbx{x@@Bh
\x7f
D`@@@@@@@@@@@@@@@@@@@@@@@@@@@
\x7f
hN{XU
\x7f
h_zPA
\x7f
PN|pU~P_xxA
\x7f
DN}xU|p_GpA@dO@pV||_FtA@hOA
\\
Vz|_FDAADOAxV{
\\
_FpABXOCXV{T_F`ABxODTV{L_F|ACpODxV{x_GPADLODpV|X_GxADpODhV|x_xlAEHODdV|x_yHA
\n
75C1E7AC20259000241G44-3NN027EXE00191`@IAEfWGby{x@@Bh
\x7f
D`@@@@@@@@@@@@@@@@@@@@@@@@@@@BxO{pT|h@y|BC@O|XT|t@yhBCDO}DT{p@xpBBpO}dT{H@ydBB`O
\x7f
LTyh@FHBAPO@PUGL@CxBAHOB
\\
UFL@BLBADOD
\\
UCh@
\x7f
dA@LOEHUB|@~|A@pOGdUB`@}dA
\x7f
xNx
\\
UAd@|hA
\x7f
lNytU@H@{PA
\n
75C1E7AC20258235041G45-3NN027EXE00191`@JAEbWGby{x@@Bh
\x7f
D`@@@@@@@@@@@@@@@@@@@@@@@@@@@C|O{hT~D@{PBC`O{HT}h@{PBCtO{
\\
T}|@{TBCXOztT}X@{TBDPO{xT~`@{TBCdO{`T}p@z|BC@OzxT|x@z|BCPO{HT}
\\
@{DBC
\\
O{@T}t@{XBC
\\
O{XT}|@{HBCTO{lT}h@zhBB|O{
\\
T}H@z
\\
B
\n
"
...
...
@@ -41,19 +41,42 @@ def test_parse_msg_header():
assert_equal
(
header
[
"
data_len
"
],
191
)
def
test_parse_goes_header
():
"""
imfv283_test.IMFV283Parser_test.test_parse_goes_header()
"""
def
test_parse_goes_header
_VIC
():
"""
imfv283_test.IMFV283Parser_test.test_parse_goes_header
_VIC
()
"""
goes_data
=
IMFV283Parser
().
_process_ness_block
(
IMFV283_EXAMPLE_VIC
,
imfv283_codes
.
OBSERVATORIES
[
"
VIC
"
],
191
)
goes_header
=
IMFV283Parser
().
_parse_goes_header
(
goes_data
)
assert_equal
(
goes_header
[
"
day
"
],
23
)
assert_equal
(
goes_header
[
"
minute
"
],
73
)
assert_equal
(
type
(
goes_header
[
"
minute
"
]),
int
)
assert_equal
(
goes_header
[
"
offset
"
],
bytearray
(
b
"
\x96\x86\xbd\xc1
"
))
assert_equal
(
goes_header
[
"
orient
"
],
0.0
)
assert_equal
(
goes_header
[
"
scale
"
],
[
1
,
1
,
1
,
1
])
actual_goes_header
=
IMFV283Parser
().
_parse_goes_header
(
goes_data
)
expected_header
=
{
"
day
"
:
23
,
"
minute
"
:
73
,
"
offset
"
:
bytearray
(
b
"
\x96\x86\xbd\xc1
"
),
"
orient
"
:
0.0
,
"
scale
"
:
[
1
,
1
,
1
,
1
],
}
assert_equal
(
actual_goes_header
,
expected_header
)
assert_equal
(
type
(
actual_goes_header
[
"
minute
"
]),
int
)
def
test_parse_goes_header_STJ
():
"""
imfv283_test.IMFV283Parser_test.test_parse_goes_header_STJ()
"""
goes_data
=
IMFV283Parser
().
_process_ness_block
(
IMFV283_EXAMPLE_STJ
,
imfv283_codes
.
OBSERVATORIES
[
"
STJ
"
],
191
)
actual_goes_header
=
IMFV283Parser
().
_parse_goes_header
(
goes_data
)
expected_header
=
{
"
day
"
:
259
,
"
minute
"
:
12
,
"
offset
"
:
bytearray
(
b
"
\x97
x
\xb8\xbe
"
),
"
orient
"
:
0.0
,
"
scale
"
:
[
1
,
1
,
1
,
1
],
}
assert_equal
(
actual_goes_header
,
expected_header
)
assert_equal
(
type
(
actual_goes_header
[
"
minute
"
]),
int
)
def
test_estimate_data_time__correct_doy
():
...
...
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