Skip to content

Commit

Permalink
Add unittest for daphn3 mutator.
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Nov 12, 2012
1 parent 03a8462 commit 0457513
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_mutate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import unittest
from ooni.kit import daphn3

class TestDaphn3(unittest.TestCase):
def test_mutate_string(self):
original_string = '\x00\x00\x00'
mutated = daphn3.daphn3MutateString(original_string, 1)
self.assertEqual(mutated, '\x00\x01\x00')
def test_mutate_daphn3(self):
original_dict = [{'client': '\x00\x00\x00'},
{'server': '\x00\x00\x00'}]
mutated_dict = daphn3.daphn3Mutate(original_dict, 1, 1)
self.assertEqual(mutated_dict, [{'client': '\x00\x00\x00'},
{'server': '\x00\x01\x00'}])

0 comments on commit 0457513

Please sign in to comment.