-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |