OXIESEC PANEL
- Current Dir:
/
/
snap
/
core24
/
988
/
usr
/
lib
/
python3
/
dist-packages
/
jsonschema
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/04/2025 04:37:50 PM
rwxr-xr-x
📄
__init__.py
0 bytes
08/14/2023 09:45:04 PM
rw-r--r--
📁
__pycache__
-
05/04/2025 04:37:50 PM
rwxr-xr-x
📄
_helpers.py
623 bytes
08/14/2023 09:45:04 PM
rw-r--r--
📄
_suite.py
6.86 KB
08/14/2023 09:45:04 PM
rw-r--r--
📄
fuzz_validate.py
1.09 KB
08/14/2023 09:45:04 PM
rw-r--r--
📄
test_cli.py
28.06 KB
08/14/2023 09:45:04 PM
rw-r--r--
📄
test_deprecations.py
3.81 KB
08/14/2023 09:45:04 PM
rw-r--r--
📄
test_exceptions.py
18.74 KB
08/14/2023 09:45:04 PM
rw-r--r--
📄
test_format.py
3.67 KB
08/14/2023 09:45:04 PM
rw-r--r--
📄
test_jsonschema_test_suite.py
20.7 KB
08/14/2023 09:45:04 PM
rw-r--r--
📄
test_types.py
6.64 KB
08/14/2023 09:45:04 PM
rw-r--r--
📄
test_utils.py
3.66 KB
08/14/2023 09:45:04 PM
rw-r--r--
📄
test_validators.py
73.71 KB
08/14/2023 09:45:04 PM
rw-r--r--
Editing: fuzz_validate.py
Close
""" Fuzzing setup for OSS-Fuzz. See https://github.com/google/oss-fuzz/tree/master/projects/jsonschema for the other half of the setup here. """ import sys from hypothesis import given, strategies import jsonschema PRIM = strategies.one_of( strategies.booleans(), strategies.integers(), strategies.floats(allow_nan=False, allow_infinity=False), strategies.text(), ) DICT = strategies.recursive( base=strategies.one_of( strategies.booleans(), strategies.dictionaries(strategies.text(), PRIM), ), extend=lambda inner: strategies.dictionaries(strategies.text(), inner), ) @given(obj1=DICT, obj2=DICT) def test_schemas(obj1, obj2): try: jsonschema.validate(instance=obj1, schema=obj2) except jsonschema.exceptions.ValidationError: pass except jsonschema.exceptions.SchemaError: pass def main(): atheris.instrument_all() atheris.Setup( sys.argv, test_schemas.hypothesis.fuzz_one_input, enable_python_coverage=True, ) atheris.Fuzz() if __name__ == "__main__": import atheris main()