Skip to content

Commit

Permalink
added test for line interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
CDonnerer committed Apr 9, 2021
1 parent 05ca898 commit 6d49781
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,49 @@ def test_plot_linear_line(x, expected_linear_line_plot):
assert plt_str == expected_linear_line_plot


@pytest.fixture
def expected_interp_plot():
return "\n".join(
[
"",
" 9┤ ",
" |: ÷÷÷ ",
" |: ÷ ",
" 6┤: ÷÷÷ ",
" |: ÷ ",
" |: ÷÷÷ ",
" 3┤: ÷ ",
" |: ÷÷÷ ",
" |: ÷ ",
" 0┤÷÷················ ",
" └┬-----┬-----┬-----┬",
" 0 3 6 9",
"",
]
)


@pytest.mark.parametrize(
"x, y",
[
([[0, 9], [0, 0], [0, 9]], [[0, 0], [0, 9], [0, 9]]),
],
)
def test_plot_interp(x, y, expected_interp_plot):

plt_str = plot(
x=x,
y=y,
figsize=(19, 10),
xlim=(0, 9),
ylim=(0, 9),
line=True,
marker=None,
return_type="str",
)
assert plt_str == expected_interp_plot


# -----------------------------------------------------------------------------
# Test `hist` function
# -----------------------------------------------------------------------------
Expand Down

0 comments on commit 6d49781

Please sign in to comment.