def test_var_obj_limits_int(self): var_obj = VariableObject(name="int_var", val=1, fuzz_types=["int"]) string = "test" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), False) string = "2" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), True)
def test_var_obj_limits_int(self): var_obj = VariableObject(name="int_var", val=1, fuzz_types=["int"]) string = "test" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), False) string = "2" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), True)
def test_var_obj_limits_max_length(self): var_obj = VariableObject(name="url_var", val="test", max_length=3) string = "abc" self.assertEqual(fuzz_datagen._check_var_obj_limits(var_obj, string), True) string = "abcde" self.assertEqual(fuzz_datagen._check_var_obj_limits(var_obj, string), False)
def test_var_obj_limits_max_length(self): var_obj = VariableObject(name="url_var", val="test", max_length=3) string = "abc" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), True) string = "abcde" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), False)
def test_var_obj_limits_url(self): var_obj = VariableObject(name="url_var", val="test", fuzz_types=["url"]) string = "cd /etc; cat passwd" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), False) string = "test" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), True)
def test_var_obj_limits_ascii(self): var_obj = VariableObject(name="ascii_var", val="test", fuzz_types=["ascii"]) string = u"\u0124\u0100\u0154\u0100\u004D\u00DF\u00EB" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), False) string = "test" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), True)
def test_var_obj_limits_url(self): var_obj = VariableObject(name="url_var", val="test", fuzz_types=["url"]) string = "cd /etc; cat passwd" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), False) string = "test" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), True)
def test_var_obj_limits_ascii(self): var_obj = VariableObject(name="ascii_var", val="test", fuzz_types=["ascii"]) string = u"\u0124\u0100\u0154\u0100\u004D\u00DF\u00EB" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), False) string = "test" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), True)
def test_var_obj_limits_fuzz(self): var_obj = VariableObject(name="no_fuzz_var", val="test", fuzz=False) string = "test" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), False)
def test_var_obj_limits_fuzz(self): var_obj = VariableObject(name="no_fuzz_var", val="test", fuzz=False) string = "test" self.assertEqual( fuzz_datagen._check_var_obj_limits(var_obj, string), False)