Skip to content

Commit

Permalink
fixed test for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfe1 committed Dec 7, 2020
1 parent b809a5c commit 1e42a52
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/Desktop/test_desktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,21 @@ def test_start_screen_recording(self):
mock_desk = MagicMock()
mock_desk._recording = None
DesktopLibrary.start_screen_recording(mock_desk)
self.assertTrue(mock_desk._recording == unittest.mock.ANY)

def test_stop_screen_recording(self):
mock_desk = MagicMock()
mock_desk._recording = None
DesktopLibrary.start_screen_recording(mock_desk)
DesktopLibrary.stop_screen_recording(mock_desk)
file = DesktopLibrary.stop_screen_recording(mock_desk)
self.assertTrue(file == unittest.mock.ANY)

def test_save_recording(self):
mock_desk = MagicMock()
mock_desk._recording = b'some data'
mock_desk._is_remotepath_set = MagicMock(return_value=False)
options = ["username=test"]
mock_desk._get_screenrecord_paths = MagicMock(return_value=("path", "link"))
file = DesktopLibrary._save_recording(mock_desk, "filename", options)
self.assertTrue(file == "path")
os.remove("path")

0 comments on commit 1e42a52

Please sign in to comment.