Beispiel #1
0
 def __init__(self, **kwargs):
     """
     Init the class with fuzzer name (command), a boolean that represent whenever the fuzzer
     accept arguments form stdin, otherwise specify a command line. The special keyword "@@"
     will be replaced with the content of argument to fuzz
     """
     self.config = JsonFactory(kwargs)
     if not ["fuzzer", "stdin", "commandline"] in self.config:
         raise PJFMissingArgument()
Beispiel #2
0
 def test_object_setitem(self):
     json = JsonFactory({"a": False})
     json["a"] = True
     self.assertTrue(json["a"])
Beispiel #3
0
 def test_object_representation(self):
     json = JsonFactory({"a": 1})
     self.assertTrue(str(json) == "{'a': 1}")
     self.assertTrue(type(str(json)) == str)
Beispiel #4
0
 def test_object_contains(self):
     json = JsonFactory({"a": 1})
     self.assertTrue(["a"] in json)
     self.assertFalse(["A"] in json)
Beispiel #5
0
 def test_object_equal(self):
     json = JsonFactory({"a": 1})
     self.assertEquals(json, {"a": 1})
     self.assertNotEqual(json, {"a": 0})
Beispiel #6
0
 def test_object_addition(self):
     json = JsonFactory({"a": 1})
     json += {"foo": True}
     self.assertTrue(json["foo"])
Beispiel #7
0
 def test_object_subtraction(self):
     json = JsonFactory({"test": 1, "test2": {"nested": 1}})
     json["test2"] = json["test2"] - ["nested"]
     self.assertTrue(json == {"test": 1, "test2": {}})
     self.assertFalse(json == {"test": 1, "test2": {"nested": 1}})
Beispiel #8
0
 def test_nested_object(self):
     self.assertTrue(JsonFactory({"t": 1, "foo": {"cow": True}}))