Skip to content

Commit

Permalink
added test_repr.py to tests/safeds/data/tabular/containers/_table
Browse files Browse the repository at this point in the history
  • Loading branch information
daniaHu committed Jun 30, 2023
1 parent c5d75df commit b4b7ed9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/safeds/data/tabular/containers/_table/test_repr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pytest
from safeds.data.tabular.containers import Table


@pytest.mark.parametrize(
("table", "expected"),
[
(Table(), "Empty DataFrame\nColumns: []\nIndex: []"),
(Table({"col1": [0]}), " col1\n0 0"),
(Table({"col1": [0, "1"], "col2": ["a", "b"]}), " col1 col2\n0 0 a\n1 1 b"),
],
ids=[
"empty table",
"table with one row",
"table with multiple rows",
],
)
def test_should_return_a_string_representation(table: Table, expected: str) -> None:
assert repr(table) == expected

0 comments on commit b4b7ed9

Please sign in to comment.