예제 #1
0
    def test_get_empty_frame_timestamp(self):
        cam = cppcam.Camera()
        timestamp = cam.get_frame_timestamp()

        self.assertEqual(timestamp['tv_sec'], 0)
        self.assertEqual(timestamp['tv_usec'], 0)
예제 #2
0
 def test_init_error(self):
     cam = cppcam.Camera()
     with self.assertRaises(IOError):
         cam.init('/dev/wtf', (1280, 720))
예제 #3
0
 def test_get_empty_frame_bytesused(self):
     cam = cppcam.Camera()
     self.assertEqual(cam.get_frame_bytesused(), 0)
예제 #4
0
 def test_get_empty_frame(self):
     cam = cppcam.Camera()
     self.assertEqual(cam.get_frame(), b'')
예제 #5
0
 def test_release_error(self):
     cam = cppcam.Camera()
     with self.assertRaises(cppcam.MunmapError):
         cam.release()
예제 #6
0
 def test_stop_capture_error(self):
     cam = cppcam.Camera()
     with self.assertRaises(cppcam.StreamOffError):
         cam.stop_capture()
예제 #7
0
 def test_read_frame_error(self):
     cam = cppcam.Camera()
     with self.assertRaises(cppcam.BufQbufError):
         cam.read_frame()