Skip to content

Commit 01aa4e1

Browse files
committed
add some tests
1 parent 5697a64 commit 01aa4e1

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

test/polyscope_test.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,22 @@ def sample_callback():
121121

122122
ps.set_user_callback(sample_callback)
123123
ps.show(3)
124-
125-
# Make sure the callback got called
126-
self.assertEqual(3, counts[0])
127-
124+
self.assertEqual(3, counts[0]) # Make sure the callback got called
128125
ps.clear_user_callback()
129126
ps.show(3)
130-
131-
# Make sure the callback didn't get called any more
132-
self.assertEqual(3, counts[0])
133-
134-
# Make sure clearing twice is ok
135-
ps.clear_user_callback()
127+
self.assertEqual(3, counts[0]) # Make sure the callback didn't get called any more
128+
ps.clear_user_callback() # Make sure clearing twice is ok
129+
130+
131+
## Test other callback functions
132+
def do_nothing_callback():
133+
pass
134+
ps.set_configure_imgui_style_callback(do_nothing_callback)
135+
ps.clear_configure_imgui_style_callback()
136+
def do_nothing_callback_2(arg):
137+
pass
138+
ps.set_files_dropped_callback(do_nothing_callback)
139+
ps.clear_files_dropped_callback()
136140

137141
def test_view_options(self):
138142

0 commit comments

Comments
 (0)