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

isis at torproject.org isis at torproject.org
Sun Mar 10 01:57:01 UTC 2013


commit 6b78de5aeaab6e9cf226fa6a05378427dc19239f
Author: Arturo Filastò <art at fuffa.org>
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)
+
+





More information about the tor-commits mailing list