-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mob next [ci-skip] [ci skip] [skip ci]
lastFile:tests/unit/test_project.py
- Loading branch information
1 parent
c648fdb
commit acf2763
Showing
2 changed files
with
49 additions
and
44 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
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 |
---|---|---|
@@ -1,17 +1,21 @@ | ||
from pandas import DataFrame | ||
from pandas.testing import assert_frame_equal | ||
from skore.project import Project | ||
import pandas | ||
from skore.project import Item, transform | ||
|
||
|
||
def test_json_item(): | ||
project = Project() | ||
d = {"a": 1, "b": 2} | ||
project.put("test", d) | ||
assert project.get("test") == d | ||
def test_transform_primitive(): | ||
o = 3 | ||
actual = transform(o) | ||
expected = Item(raw=3, raw_class_name="primitive", serialized="3") | ||
assert actual == expected | ||
|
||
|
||
def test_dataframe_item(): | ||
project = Project() | ||
df = DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}) | ||
project.put("pandas", df) | ||
assert_frame_equal(project.get("pandas"), df) | ||
def test_transform_pandas_dataframe(): | ||
o = pandas.DataFrame() | ||
actual = transform(o) | ||
expected = Item( | ||
raw=pandas.DataFrame(), raw_class_name="pandas.DataFrame", serialized="" | ||
) | ||
assert actual == expected | ||
|
||
# o = 3.3 | ||
# transform(o) |