Skip to content

Commit cc930f7

Browse files
nbtknbtk
nbtk
authored andcommitted
DCXレポートタイプの一致を確認するテスト項目を追加
1 parent 00c3452 commit cc930f7

File tree

1 file changed

+29
-16
lines changed

1 file changed

+29
-16
lines changed

tests/test.py

+29-16
Original file line numberDiff line numberDiff line change
@@ -202,19 +202,32 @@ def test_decode_error():
202202
'ublox')
203203

204204

205-
def test_not_implemented():
206-
with pytest.raises(azarashi.QzssDcrDecoderNotImplementedError):
207-
# sent from a foreign country
208-
azarashi.decode('53B3F8016DB2220D27800227DF1DDC42C080000000000000000000031363608', 'hex')
209-
210-
with pytest.raises(azarashi.QzssDcrDecoderNotImplementedError):
211-
# sent from a foreign country
212-
azarashi.decode('$QZQSM,53,53B3F8016DB2220D27800227DF1DDC42C080000000000000000000031363608*01')
213-
214-
with pytest.raises(azarashi.QzssDcrDecoderNotImplementedError):
215-
# sent from a foreign country
216-
azarashi.decode(b'\xB5\x62\x02\x13\x2C\x00\x05\x04\x01\x00\x09\x3F\x02\x00\x01\xF8'
217-
b'\xB3\xC6\x09\x22\x81\x23\x98\xF5\x80\x65\xB5\x92\xFB\xDF\x00\xFD'
218-
b'\xB8\x6F\x00\x00\x00\x00\x02\x00\x00\x00\x54\x3D\x1F\x97\xF3\xD8'
219-
b'\x50\xF2\xE3\xC2',
220-
'ublox')
205+
#def test_not_implemented():
206+
# with pytest.raises(azarashi.QzssDcrDecoderNotImplementedError):
207+
# # sent from a foreign country
208+
# azarashi.decode('53B3F8016DB2220D27800227DF1DDC42C080000000000000000000031363608', 'hex')
209+
#
210+
# with pytest.raises(azarashi.QzssDcrDecoderNotImplementedError):
211+
# # sent from a foreign country
212+
# azarashi.decode('$QZQSM,53,53B3F8016DB2220D27800227DF1DDC42C080000000000000000000031363608*01')
213+
#
214+
# with pytest.raises(azarashi.QzssDcrDecoderNotImplementedError):
215+
# # sent from a foreign country
216+
# azarashi.decode(b'\xB5\x62\x02\x13\x2C\x00\x05\x04\x01\x00\x09\x3F\x02\x00\x01\xF8'
217+
# b'\xB3\xC6\x09\x22\x81\x23\x98\xF5\x80\x65\xB5\x92\xFB\xDF\x00\xFD'
218+
# b'\xB8\x6F\x00\x00\x00\x00\x02\x00\x00\x00\x54\x3D\x1F\x97\xF3\xD8'
219+
# b'\x50\xF2\xE3\xC2',
220+
# 'ublox')
221+
222+
def test_dcx():
223+
null_msg = azarashi.decode('$QZQSM,54,53B0840DE0000000000000000000000000000000000000000000000012ACBD4*0F')
224+
assert type(null_msg) is azarashi.qzss_dc_report.QzssDcxNullMsg
225+
226+
org_outside_jpn = azarashi.decode('$QZQSM,53,9AB08408E0598969E00066AFFE8E6F70091200000000000000000100CD1A410*09')
227+
assert type(org_outside_jpn) is azarashi.qzss_dc_report.QzssDcxOutsideJapan
228+
229+
l_alert = azarashi.decode('$QZQSM,54,9AB0840DE10208ADE0000000000000000000011340000000000000132F0D238*05')
230+
assert type(l_alert) is azarashi.qzss_dc_report.QzssDcxLAlert
231+
232+
j_alert = azarashi.decode('$QZQSM,55,53B0840DE31188FC208600000000000000001FFFFFFFFFFFC00000120738628*00')
233+
assert type(j_alert) is azarashi.qzss_dc_report.QzssDcxJAlert

0 commit comments

Comments
 (0)