Skip to content

Commit

Permalink
tests: add some data tests
Browse files Browse the repository at this point in the history
  • Loading branch information
machow committed Oct 26, 2023
1 parent e38a7e6 commit f273bb9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/test_gt_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import pandas as pd

from gt._gt_data import Stub, RowInfo
from gt._gt_data import RowGroups


def test_stub_construct_manual():
stub = Stub([RowInfo(0), RowInfo(1)])
assert stub[0] == RowInfo(0)


def test_stub_construct_df():
stub = Stub(pd.DataFrame({"x": [8, 9]}))

assert len(stub) == 2
assert stub[0] == RowInfo(0)
assert stub[1] == RowInfo(1)


def test_row_groups_construct_manual():
groups = RowGroups(["a", "b"])

assert len(groups) == 2
assert groups[0] == "a"
assert groups[1] == "b"

assert isinstance(groups[:], RowGroups)

0 comments on commit f273bb9

Please sign in to comment.