We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bae496e commit c41845fCopy full SHA for c41845f
test/test_player.py
@@ -10,6 +10,7 @@
10
from unittest.mock import Mock
11
import os
12
import sys
13
+import io
14
import can
15
import can.player
16
@@ -48,8 +49,10 @@ def test_play_virtual(self):
48
49
50
def test_play_virtual_verbose(self):
51
sys.argv = self.baseargs + ["-v", self.logfile]
- can.player.main()
52
- # TODO: add test message was printed
+ with unittest.mock.patch('sys.stdout', new_callable=io.StringIO) as mock_stdout:
53
+ can.player.main()
54
+ self.assertIn('09 08 07 06 05 04 03 02', mock_stdout.getvalue())
55
+ self.assertIn('05 0c 00 00 00 00 00 00', mock_stdout.getvalue())
56
self.assertEqual(self.mock_virtual_bus.send.call_count, 2)
57
self.assertEqual(self.MockSleep.call_count, 2)
58
self.assertSuccessfullCleanup()
0 commit comments