Skip to content

Commit c53275d

Browse files
committed
add simple repr check
1 parent f32ee5b commit c53275d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/nested_pandas/nestedframe/test_nestedframe.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,24 @@ def test_nestedseries_construction():
3434
assert (frame[0] == [1, 2, 3]).all()
3535

3636

37+
def test_html_repr():
38+
"""Just make sure the html representation code doesn't throw any errors"""
39+
40+
base = NestedFrame(data={"a": [1, 2, 3], "b": [2, 4, 6]}, index=[0, 1, 2])
41+
42+
assert list(base.all_columns.keys()) == ["base"]
43+
assert list(base.all_columns["base"]) == list(base.columns)
44+
45+
nested = pd.DataFrame(
46+
data={"c": [0, 2, 4, 1, 4, 3, 1, 4, 1], "d": [5, 4, 7, 5, 3, 1, 9, 3, 4]},
47+
index=[0, 0, 0, 1, 1, 1, 2, 2, 2],
48+
)
49+
50+
base = base.add_nested(nested, "nested")
51+
52+
base._repr_html_()
53+
54+
3755
def test_all_columns():
3856
"""Test the all_columns function"""
3957

0 commit comments

Comments
 (0)