[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Basic unittest for representing scapy packets



commit 6b78de5aeaab6e9cf226fa6a05378427dc19239f
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Tue Nov 27 02:12:38 2012 +0100

    Basic unittest for representing scapy packets
    (cherry picked from commit 442a4a3aa716bfcc3f8f2cd2e249dc000f991950)
---
 tests/test_safe_represent.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/tests/test_safe_represent.py b/tests/test_safe_represent.py
new file mode 100644
index 0000000..82a5196
--- /dev/null
+++ b/tests/test_safe_represent.py
@@ -0,0 +1,14 @@
+import yaml
+
+from twisted.trial import unittest
+
+from ooni.reporter import OSafeDumper
+
+from scapy.all import IP, UDP
+
+class TestScapyRepresent(unittest.TestCase):
+    def test_represent_scapy(self):
+        data = IP()/UDP()
+        yaml.dump_all([data], Dumper=OSafeDumper)
+
+



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits