Пример #1
0
 def test_fuzz_json_list(self):
     expected = [(['abc', 'b'], 'a'),
                 (['53', 'b'], 'a'),
                 (['a', 'abc'], 'b'),
                 (['a', '53'], 'b')]
     generated = _fuzz_json(self.payloads, ['a', 'b'], False)
     self.assertEqual(generated, expected)
Пример #2
0
 def test_fuzz_json_dict(self):
     expected = [({'a': 'abc', 'c': 'd'}, 'b'),
                 ({'a': '53', 'c': 'd'}, 'b'),
                 ({'a': 'b', 'c': 'abc'}, 'd'),
                 ({'a': 'b', 'c': '53'}, 'd')]
     generated = _fuzz_json(self.payloads, {"a": "b", "c": "d"}, False)
     self.assertEqual(generated, expected)
Пример #3
0
 def test_fuzz_json_str(self):
     expected = [('abc', 'str'), ('53', 'str')]
     generated = _fuzz_json(self.payloads, 'str', False)
     self.assertEqual(generated, expected)
Пример #4
0
 def test_fuzz_json_int(self):
     expected = [(53, 1)]
     generated = _fuzz_json(self.payloads, 1, False)
     self.assertEqual(generated, expected)