summaryrefslogtreecommitdiff
path: root/libardrone/test_paveparser.py
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-01-07 17:51:55 +0100
committerFlorian Jung <flo@windfisch.org>2015-01-07 17:51:55 +0100
commit5772af4eed51e45de06b1329ed3be3158c4c2ccf (patch)
tree33d67d69bfa7a5a1b18d73203119c263a8815ded /libardrone/test_paveparser.py
parenta1de75322f87cd6adea4afcf3470d2466d0881b8 (diff)
server2
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()