|
38 | 38 | line1_2 = "1 38771U 12049A 21137.30264622 .00000000 00000+0 -49996-5 0 00017"
|
39 | 39 | line2_2 = "2 38771 98.7162 197.7716 0002383 106.1049 122.6344 14.21477797449453"
|
40 | 40 |
|
| 41 | + |
| 42 | +NOAA19_2LINES = """1 33591U 09005A 21355.91138073 .00000074 00000+0 65091-4 0 9998 |
| 43 | +2 33591 99.1688 21.1338 0013414 329.8936 30.1462 14.12516400663123 |
| 44 | +""" |
| 45 | +NOAA19_3LINES = "NOAA 19\n" + NOAA19_2LINES |
| 46 | + |
41 | 47 | tle_xml = '\n'.join(
|
42 | 48 | ('<?xml version="1.0" encoding="UTF-8"?>',
|
43 | 49 | '<multi-mission-administrative-message>',
|
@@ -117,6 +123,32 @@ def test_from_file(self):
|
117 | 123 | finally:
|
118 | 124 | remove(filename)
|
119 | 125 |
|
| 126 | + def test_from_file_with_hyphenated_platform_name(self): |
| 127 | + """Test reading and parsing from a file with a slightly different name.""" |
| 128 | + from tempfile import mkstemp |
| 129 | + from os import write, close, remove |
| 130 | + filehandle, filename = mkstemp() |
| 131 | + try: |
| 132 | + write(filehandle, NOAA19_3LINES.encode('utf-8')) |
| 133 | + close(filehandle) |
| 134 | + tle = Tle("NOAA-19", filename) |
| 135 | + assert tle.satnumber == "33591" |
| 136 | + finally: |
| 137 | + remove(filename) |
| 138 | + |
| 139 | + def test_from_file_with_no_platform_name(self): |
| 140 | + """Test reading and parsing from a file with a slightly different name.""" |
| 141 | + from tempfile import mkstemp |
| 142 | + from os import write, close, remove |
| 143 | + filehandle, filename = mkstemp() |
| 144 | + try: |
| 145 | + write(filehandle, NOAA19_2LINES.encode('utf-8')) |
| 146 | + close(filehandle) |
| 147 | + tle = Tle("NOAA-19", filename) |
| 148 | + assert tle.satnumber == "33591" |
| 149 | + finally: |
| 150 | + remove(filename) |
| 151 | + |
120 | 152 | def test_from_mmam_xml(self):
|
121 | 153 | """Test reading from an MMAM XML file."""
|
122 | 154 | from tempfile import TemporaryDirectory
|
|
0 commit comments