Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
(cherry picked from commit 6a8d77d)
  • Loading branch information
jorobert authored and bbassett-tibco committed Feb 10, 2022
1 parent 768041a commit 73e34bd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spotfire/test/test_sbdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,11 @@ def test_write_unicode(self):
udf2 = sbdf.import_data(tempdir + "\\test.sbdf")
for i in range(3):
self.assertEqual(udf.at[i, "x"], udf2.at[i, "x"])


def test_read_write_alltypes(self):
"""Test that all data types can be properly roundtripped read/write"""
dataframe = sbdf.import_data(f"{os.path.dirname(__file__)}/files/sbdf/alltypes.sbdf")
with tempfile.TemporaryDirectory() as tempdir:
sbdf.export_data(dataframe, tempdir + "\\test.sbdf")
df2 = sbdf.import_data(tempdir + "\\test.sbdf")
self.assertTrue(dataframe.equals(df2))

0 comments on commit 73e34bd

Please sign in to comment.