Example #1
0
    def test_screenshot(self):
        recorder = Recorder("./", 8)

        # Very simple test, just ensure that the counter got incremented.
        # Then we can be certain the other code ran previously.
        recorder.screenshot()
        self.assertEqual(recorder.screenshot_counter, 1)
Example #2
0
    def test_get_recording_time(self):
        recorder = Recorder("./", 8)
        recorder.screenshot_counter = 5
        test_string = str(5 * 8) + " seconds"

        self.assertEqual(recorder.get_recording_time(), test_string)
        self.assertEqual(type(recorder.get_recording_time()), str)
Example #3
0
    def test_run(self):
        recorder = Recorder("./", 8)

        # Assert the boolean is false upon initialisation.
        self.assertEqual(recorder._stop.is_set(), False)
Example #4
0
 def test_init_method(self):
     recorder = Recorder("./", 8)
     self.assertEqual(type(recorder._stop),
                      multiprocessing.synchronize.Event)
     self.assertEqual(recorder.interval, 8)
Example #5
0
 def test_init_method(self):
     recorder = Recorder("./", 8)
     self.assertEqual(type(recorder._stop), threading.Event)
     self.assertEqual(recorder.interval, 8)