Skip to content

Commit

Permalink
[CI] Add back tests for df conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
klieret committed May 6, 2019
1 parent c703b48 commit c9683b1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions ankipandas/test/test_ankidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,37 @@ def test_remove_tag(self):
[True]
)

# Formats
# ==========================================================================

def test_reformat_trivial(self):
for table in ["notes", "revs", "cards"]:
with self.subTest(table=table):
adf = AnkiDF._table_constructor(
path=self.db_path, user=None, table=table
)
adf2 = adf.normalize()
self.assertTrue(adf.equals(adf2))

def test_compare_convert_raw_load_raw(self):
for table in ["notes", "revs", "cards"]:
with self.subTest(table=table):
adf = AnkiDF._table_constructor(
path=self.db_path, user=None, table=table
).raw()
df = core.get_table(self.db, table)
if table == "notes":
df["tags"] = df["tags"].str.strip()
self.assertTrue(adf.equals(df))

def test_raw_normalize(self):
for table in ["notes", "revs", "cards"]:
with self.subTest(table=table):
adf = AnkiDF._table_constructor(
path=self.db_path, user=None, table=table
)
adf2 = adf.raw().normalize()
self.assertTrue(adf.equals(adf2))

# Help
# ==========================================================================
Expand Down

0 comments on commit c9683b1

Please sign in to comment.