Skip to content

Commit

Permalink
test return value in test_df_to_html_table and no file written if fil…
Browse files Browse the repository at this point in the history
…e_path=None
  • Loading branch information
janosh committed Feb 11, 2024
1 parent b17d6be commit 04089c5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,27 @@ def test_df_to_html_table(
) -> None:
file_path = tmp_path / "test_df.svelte"

df_to_html_table(
html1 = df_to_html_table(
df_mixed.style,
script=script,
styles=styles,
inline_props=inline_props,
styler_css=styler_css,
)
assert not file_path.is_file()
html2 = df_to_html_table(
df_mixed.style,
file_path,
script=script,
styles=styles,
inline_props=inline_props,
styler_css=styler_css,
)
assert html1 == html2

assert file_path.is_file()
html_text = file_path.read_text()
assert html2 == html_text

if script is not None:
assert script.split("<table")[0] in html_text, html_text
Expand Down

0 comments on commit 04089c5

Please sign in to comment.