Esempio n. 1
0
def test_extra_lines_in_tle_are_ignored():
    f = BytesIO(b'Sample line\n' + sample_celestrak_text + b'Another line\n')
    s = list(parse_tle(f))
    assert len(s) == 2
    assert s[0][0] == ['ISS (ZARYA)', 'ISS', 'ZARYA']
    assert s[0][1].name == 'ISS (ZARYA)'
    assert s[1][0] == ['FLOCK 2E-1']
    assert s[1][1].name == 'FLOCK 2E-1'
def test_extra_lines_in_tle_are_ignored():
    f = BytesIO(b'Sample line\n' + sample_celestrak_text + b'Another line\n')
    s = list(parse_tle(f))
    assert len(s) == 2
    assert s[0][0] == ['ISS (ZARYA)', 'ISS', 'ZARYA']
    assert s[0][1].name == 'ISS (ZARYA)'
    assert s[1][0] == ['FLOCK 2E-1']
    assert s[1][1].name == 'FLOCK 2E-1'
Esempio n. 3
0
def test_spacetrack_three_line():
    f = BytesIO(sample_spacetrack_three_line_text)
    s = list(parse_tle(f))
    assert len(s) == 2
    print(s)
    assert s[0][0] == ['First']
    assert s[0][1].name == 'First'
    assert s[1][0] == ['Second']
    assert s[1][1].name == 'Second'
Esempio n. 4
0
def test_spacetrack_two_line():
    f = BytesIO(sample_spacetrack_two_line_text)
    s = list(parse_tle(f))
    assert len(s) == 2
    print(s)
    assert s[0][0] == ()
    assert s[0][1].name is None
    assert s[1][0] == ()
    assert s[1][1].name is None
Esempio n. 5
0
def test_celestrak():
    f = BytesIO(sample_celestrak_text)
    s = list(parse_tle(f))
    print(s)
    assert len(s) == 2
    assert s[0][0] == ['ISS (ZARYA)', 'ISS', 'ZARYA']
    assert s[0][1].name == 'ISS (ZARYA)'
    assert s[1][0] == ['FLOCK 2E-1']
    assert s[1][1].name == 'FLOCK 2E-1'
def test_spacetrack_three_line():
    f = BytesIO(sample_spacetrack_three_line_text)
    s = list(parse_tle(f))
    assert len(s) == 2
    print(s)
    assert s[0][0] == ['First']
    assert s[0][1].name == 'First'
    assert s[1][0] == ['Second']
    assert s[1][1].name == 'Second'
def test_spacetrack_two_line():
    f = BytesIO(sample_spacetrack_two_line_text)
    s = list(parse_tle(f))
    assert len(s) == 2
    print(s)
    assert s[0][0] == ()
    assert s[0][1].name is None
    assert s[1][0] == ()
    assert s[1][1].name is None
def test_celestrak():
    f = BytesIO(sample_celestrak_text)
    s = list(parse_tle(f))
    print(s)
    assert len(s) == 2
    assert s[0][0] == ['ISS (ZARYA)', 'ISS', 'ZARYA']
    assert s[0][1].name == 'ISS (ZARYA)'
    assert s[1][0] == ['FLOCK 2E-1']
    assert s[1][1].name == 'FLOCK 2E-1'