def test_plot_draws_fig(dummy_data): geodesic = dummy_data cl = InteractiveGeodesicPlotter() cl.plot(geodesic) fig = cl.show() assert cl.attractor_present assert fig
def test_interactive_geod_plotter_draws_plot(dummy_geod): geod = dummy_geod igpl = InteractiveGeodesicPlotter() igpl.plot(geod) fig = igpl.show() assert fig
def test_interactive_geod_plotter_show_clear(dummy_geod): geod = dummy_geod igpl = InteractiveGeodesicPlotter(draw_ergosphere=False) igpl.plot(geod) assert isinstance(igpl.show(), Figure) igpl.clear() assert igpl.fig.data == ()
def test_save_saves_plot(mock_save, dummy_data): geodesic = dummy_data cl = InteractiveGeodesicPlotter() cl.plot(geodesic) name = "test_plot.png" cl.save(name) basename, ext = os.path.splitext(name) mock_save.assert_called_with( cl.fig, image=ext[1:], image_filename=basename, show_link=False )
def test_interactive_geod_plotter_saves_plot(mock_save, dummy_geod): geod = dummy_geod igpl = InteractiveGeodesicPlotter() igpl.plot(geod) name = "test_plot.png" igpl.save(name) basename, ext = os.path.splitext(name) mock_save.assert_called_with( igpl.fig, image=ext[1:], image_filename=basename, show_link=False )
def test_plot_calls_draw_attractor_AutoScale(dummy_data): geodesic = dummy_data cl = InteractiveGeodesicPlotter() cl.plot(geodesic) assert cl.attractor_present
def test_plot_calls_draw_attractor_Manualscale(dummy_data): geodesic = dummy_data cl = InteractiveGeodesicPlotter(attractor_radius_scale=1500) cl.plot(geodesic) assert cl.attractor_present assert cl.attractor_radius_scale == 1500