Пример #1
0
def test_geostationary_input(attractor):
    with pytest.raises(ValueError) as excinfo:
        Orbit.geostationary(attractor=attractor)

    assert (
        "ValueError: At least one among angular_velocity or period must be passed"
        in excinfo.exconly())
Пример #2
0
def test_geostationary_non_existence_condition(attractor, period, hill_radius):
    with pytest.raises(ValueError) as excinfo:
        Orbit.geostationary(attractor=attractor,
                            period=period,
                            hill_radius=hill_radius)

    assert ("Geostationary orbit for the given parameters doesn't exist"
            in excinfo.exconly())
Пример #3
0
def test_geostationary_creation_with_Hill_radius(attractor, period,
                                                 hill_radius, expected_a):
    ss = Orbit.geostationary(attractor=attractor,
                             period=period,
                             hill_radius=hill_radius)
    assert_quantity_allclose(ss.a, expected_a, rtol=1.0e-7)
    assert_quantity_allclose(ss.period, period, rtol=1.0e-7)
Пример #4
0
def test_geostationary_creation_from_angular_velocity(attractor,
                                                      angular_velocity,
                                                      expected_a,
                                                      expected_period):
    ss = Orbit.geostationary(attractor=attractor,
                             angular_velocity=angular_velocity)
    assert_quantity_allclose(ss.a, expected_a, rtol=1.0e-7)
    assert_quantity_allclose(ss.period, expected_period, rtol=1.0e-7)
Пример #5
0
def test_geostationary_creation_from_period(attractor, period, expected_a):
    ss = Orbit.geostationary(attractor=attractor, period=period)
    assert_quantity_allclose(ss.a, expected_a, rtol=1.0e-7)
    assert_quantity_allclose(ss.period, period, rtol=1.0e-7)