Exemplo n.º 1
0
def test_all_ra_coordinates():
    expected = (19. + (30. / 60.) + (24. / 3600.)) * 15.

    for coord_value in [
            '19 30 24',
            '19:30:24',
            (19. + (30. / 60.) + (24. / 3600.)) * 15.,
            ]:
        assert Coordinate.sanitise_ra(coord_value) == expected
Exemplo n.º 2
0
def test_bad_ra_coordinate(coordinate):
    coordinate.ra = "thisisatest"
    with pytest.raises(CannotParseCoordinate) as err:
        Coordinate.sanitise_ra(coordinate.ra)
Exemplo n.º 3
0
def test_ra_to_coordinate(coordinate):
    expected = (19. + (30. / 60.) + (24. / 3600.)) * 15.
    assert Coordinate.sanitise_ra(coordinate.ra) == expected