File: test_fractal.py

package info (click to toggle)
einsteinpy 0.4.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 40,712 kB
  • sloc: python: 8,196; makefile: 146
file content (19 lines) | stat: -rw-r--r-- 473 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from io import StringIO
from unittest import mock

import plotly.graph_objects as go

from einsteinpy.plotting import fractal


@mock.patch.object(go.Figure, "show")
@mock.patch("sys.stdout", new_callable=StringIO)
def test_fractal_shows_figure(mock_stdout, mock_show):
    fig = fractal(divs=2, show=True)
    mock_show.assert_any_call()
    assert "plotly" in mock_stdout.getvalue()


def test_fractal_draws_figure():
    fig = fractal(divs=2, show=False)
    assert fig