summaryrefslogtreecommitdiff
path: root/libardrone/test_paveparser.py
diff options
context:
space:
mode:
Diffstat (limited to 'libardrone/test_paveparser.py')
-rw-r--r--libardrone/test_paveparser.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/libardrone/test_paveparser.py b/libardrone/test_paveparser.py
new file mode 100644
index 0000000..49e65f9
--- /dev/null
+++ b/libardrone/test_paveparser.py
@@ -0,0 +1,20 @@
+import paveparser
+import mock
+import os
+
+
+def test_misalignment():
+ outfile = mock.Mock()
+ p = paveparser.PaVEParser(outfile)
+ example_video_stream = open(os.path.join(os.path.dirname(__file__), 'ardrone2_video_example.capture'))
+ while True:
+ data = example_video_stream.read(1000000)
+ if len(data) == 0:
+ break
+ p.write(data)
+
+ assert outfile.write.called
+ assert p.misaligned_frames < 3
+
+if __name__ == "__main__":
+ test_misalignment()