Skip to content

Commit 0907785

Browse files
committed
Add test for Keyboard interrupt during execution
1 parent fefdd53 commit 0907785

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/test_player.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ def test_play_virtual_verbose(self):
5050
self.assertEqual(self.MockSleep.call_count, 2)
5151
self.assertSuccessfullCleanup()
5252

53+
def test_play_virtual_exit(self):
54+
self.MockSleep.side_effect = KeyboardInterrupt
55+
56+
sys.argv = self.baseargs + [self.logfile]
57+
can.player.main()
58+
self.assertEqual(self.MockSleep.call_count, 1)
59+
self.assertSuccessfullCleanup()
60+
5361

5462
if __name__ == "__main__":
5563
unittest.main()

0 commit comments

Comments
 (0)