Skip to content
Snippets Groups Projects
Commit db76fc31 authored by Cain, Payton David's avatar Cain, Payton David
Browse files

Add STJ packet/write test

parent 4a752cc2
No related branches found
No related tags found
2 merge requests!146Release CMO metadata to production,!34Update bitwise calculation for GOES header
......@@ -21,7 +21,7 @@ IMFV283_EXAMPLE_FRD = (
+ b"@cVAjT@[CAVW@cWAjT@[CAVT@cWAjU@[AAVO@cYAjV@Z}AVK@c[AjV"
)
IMFV283_EXAMPLE_SJT = (
IMFV283_EXAMPLE_STJ = (
b"75C1E7AC20259002641G44-3NN027EXE00191`@OA@BWGbx{"
+ b"x@@Bh\x7fD`@@@@@@@@@@@@@@@@@@@@@@@@@@@FDODdV}X_yxAGHODlV~L_z|AG"
+ b"tODPV\x7f@_{pAxLOC`V\x7fp_|pAxPOBdV@D`}dAxdOAxVAX`~lAx`O@|VAp`\x7fXAyDO@tVCd`@\\Bx`O\x7fXUC|`APByDO\x7fdUEd`AtBx`O~\\UEp`BXBGtO}PUFP`CHB \n75C1E7AC20259001441G44-3NN027EXE00191`@LA@BWGbx{x@@Bh\x7fD`@@@@@@@@@@@@@@@@@@@@@@@@@@@\x7fhN{XU\x7fh_zPA\x7fPN|pU~P_xxA\x7fDN}xU|p_GpA@dO@pV||_FtA@hOA\\Vz|_FDAADOAxV{\\_FpABXOCXV{T_F`ABxODTV{L_F|ACpODxV{x_GPADLODpV|X_GxADpODhV|x_xlAEHODdV|x_yHA \n75C1E7AC20259000241G44-3NN027EXE00191`@IAEfWGby{x@@Bh\x7fD`@@@@@@@@@@@@@@@@@@@@@@@@@@@BxO{pT|h@y|BC@O|XT|t@yhBCDO}DT{p@xpBBpO}dT{H@ydBB`O\x7fLTyh@FHBAPO@PUGL@CxBAHOB\\UFL@BLBADOD\\UCh@\x7fdA@LOEHUB|@~|A@pOGdUB`@}dA\x7fxNx\\UAd@|hA\x7flNytU@H@{PA \n75C1E7AC20258235041G45-3NN027EXE00191`@JAEbWGby{x@@Bh\x7fD`@@@@@@@@@@@@@@@@@@@@@@@@@@@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"\x97x\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():
......
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