Skip to content

Commit

Permalink
Add an error test case
Browse files Browse the repository at this point in the history
  • Loading branch information
jmao-denver committed Sep 16, 2024
1 parent c8de273 commit c20d423
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions py/server/tests/test_table_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,18 @@ def on_success():
while success_count < 5:
sleep(0.1)
self.assertEqual(keyed_input_table.size, 0)
t1 = t.drop_columns("String")

with self.subTest("schema mismatch"):
error_count = 0
def on_error(e: Exception):
nonlocal error_count
error_count += 1

append_only_input_table = input_table(col_defs=t1.definition)
with self.assertRaises(DHError) as cm:
append_only_input_table.add_async(t, on_success=on_success, on_error=on_error)
self.assertEqual(error_count, 0)


if __name__ == '__main__':
Expand Down

0 comments on commit c20d423

Please sign in to comment.