summaryrefslogtreecommitdiff
path: root/libardrone/test_h264_decoder.py
diff options
context:
space:
mode:
Diffstat (limited to 'libardrone/test_h264_decoder.py')
-rw-r--r--libardrone/test_h264_decoder.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/libardrone/test_h264_decoder.py b/libardrone/test_h264_decoder.py
new file mode 100644
index 0000000..1107fd7
--- /dev/null
+++ b/libardrone/test_h264_decoder.py
@@ -0,0 +1,17 @@
+import paveparser
+import mock
+import h264decoder
+import os
+
+
+def test_h264_decoder():
+ outfileobj = mock.Mock()
+ decoder = h264decoder.H264Decoder(outfileobj)
+ example_video_stream = open(os.path.join(os.path.dirname(__file__), 'paveparser.output'))
+ while True:
+ data = example_video_stream.read(1000)
+ if len(data) == 0:
+ break
+ decoder.write(data)
+
+ assert outfileobj.image_ready.called