|
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 | | -NOAA19_LINES = """NOAA 19 |
42 | | -1 33591U 09005A 21355.91138073 .00000074 00000+0 65091-4 0 9998 |
| 41 | + |
| 42 | +NOAA19_2LINES = """1 33591U 09005A 21355.91138073 .00000074 00000+0 65091-4 0 9998 |
43 | 43 | 2 33591 99.1688 21.1338 0013414 329.8936 30.1462 14.12516400663123 |
44 | 44 | """ |
| 45 | +NOAA19_3LINES = "NOAA 19\n" + NOAA19_2LINES |
45 | 46 |
|
46 | 47 | tle_xml = '\n'.join( |
47 | 48 | ('<?xml version="1.0" encoding="UTF-8"?>', |
@@ -135,6 +136,32 @@ def test_from_file_with_hyphenated_platform_name(self): |
135 | 136 | finally: |
136 | 137 | remove(filename) |
137 | 138 |
|
| 139 | + def test_from_file_with_hyphenated_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_3LINES.encode('utf-8')) |
| 146 | + close(filehandle) |
| 147 | + tle = Tle("NOAA-19", filename) |
| 148 | + assert tle.satnumber == "33591" |
| 149 | + finally: |
| 150 | + remove(filename) |
| 151 | + |
| 152 | + def test_from_file_with_no_platform_name(self): |
| 153 | + """Test reading and parsing from a file with a slightly different name.""" |
| 154 | + from tempfile import mkstemp |
| 155 | + from os import write, close, remove |
| 156 | + filehandle, filename = mkstemp() |
| 157 | + try: |
| 158 | + write(filehandle, NOAA19_2LINES.encode('utf-8')) |
| 159 | + close(filehandle) |
| 160 | + tle = Tle("NOAA-19", filename) |
| 161 | + assert tle.satnumber == "33591" |
| 162 | + finally: |
| 163 | + remove(filename) |
| 164 | + |
138 | 165 | def test_from_mmam_xml(self): |
139 | 166 | """Test reading from an MMAM XML file.""" |
140 | 167 | from tempfile import TemporaryDirectory |
|
0 commit comments