Exemplo n.º 1
0
def test_plot_save_saves_plot(mock_save, dummy_data):
    sph_obj, _, m, _, el, ss = dummy_data
    cl = StaticGeodesicPlotter(m)
    cl.plot(sph_obj, el, ss)
    name = "test_plot.png"
    cl.save(name)
    mock_save.assert_called_with(name)
Exemplo n.º 2
0
def test_plot_save_saves_plot(mock_save, dummy_data):
    geodesic = dummy_data
    cl = StaticGeodesicPlotter()
    cl.plot(geodesic)
    name = "test_plot.png"
    cl.save(name)
    mock_save.assert_called_with(name)
Exemplo n.º 3
0
def test_plot_geod_save_saves_parametric_plot(mock_save, dummy_geod):
    geod = dummy_geod

    sgpl = StaticGeodesicPlotter()
    sgpl.parametric_plot(geod)
    name = "Parametric.png"
    sgpl.save()

    mock_save.assert_called_with(name)
    assert sgpl.ax.name != "3d"
Exemplo n.º 4
0
def test_plot_save_saves_plot(mock_save):
    r = [306 * u.m, np.pi / 2 * u.rad, np.pi / 2 * u.rad]
    v = [0 * u.m / u.s, 0 * u.rad / u.s, 951.0 * u.rad / u.s]
    m = 4e24 * u.kg
    el = 0.002
    ss = 0.5e-6
    cl = StaticGeodesicPlotter(m)
    cl.plot(r, v, el, ss)
    name = "test_plot.png"
    cl.save(name)
    mock_save.assert_called_with(name)