REDROOM
PHP 8.5.2
Path:
Logout
Edit File
Size: 3.66 KB
Close
//lib/python3/dist-packages/jsonschema/tests/test_utils.py
Text
Base64
from unittest import TestCase from jsonschema._utils import equal class TestEqual(TestCase): def test_none(self): self.assertTrue(equal(None, None)) class TestDictEqual(TestCase): def test_equal_dictionaries(self): dict_1 = {"a": "b", "c": "d"} dict_2 = {"c": "d", "a": "b"} self.assertTrue(equal(dict_1, dict_2)) def test_missing_key(self): dict_1 = {"a": "b", "c": "d"} dict_2 = {"c": "d", "x": "b"} self.assertFalse(equal(dict_1, dict_2)) def test_additional_key(self): dict_1 = {"a": "b", "c": "d"} dict_2 = {"c": "d", "a": "b", "x": "x"} self.assertFalse(equal(dict_1, dict_2)) def test_missing_value(self): dict_1 = {"a": "b", "c": "d"} dict_2 = {"c": "d", "a": "x"} self.assertFalse(equal(dict_1, dict_2)) def test_empty_dictionaries(self): dict_1 = {} dict_2 = {} self.assertTrue(equal(dict_1, dict_2)) def test_one_none(self): dict_1 = None dict_2 = {"a": "b", "c": "d"} self.assertFalse(equal(dict_1, dict_2)) def test_same_item(self): dict_1 = {"a": "b", "c": "d"} self.assertTrue(equal(dict_1, dict_1)) def test_nested_equal(self): dict_1 = {"a": {"a": "b", "c": "d"}, "c": "d"} dict_2 = {"c": "d", "a": {"a": "b", "c": "d"}} self.assertTrue(equal(dict_1, dict_2)) def test_nested_dict_unequal(self): dict_1 = {"a": {"a": "b", "c": "d"}, "c": "d"} dict_2 = {"c": "d", "a": {"a": "b", "c": "x"}} self.assertFalse(equal(dict_1, dict_2)) def test_mixed_nested_equal(self): dict_1 = {"a": ["a", "b", "c", "d"], "c": "d"} dict_2 = {"c": "d", "a": ["a", "b", "c", "d"]} self.assertTrue(equal(dict_1, dict_2)) def test_nested_list_unequal(self): dict_1 = {"a": ["a", "b", "c", "d"], "c": "d"} dict_2 = {"c": "d", "a": ["b", "c", "d", "a"]} self.assertFalse(equal(dict_1, dict_2)) class TestListEqual(TestCase): def test_equal_lists(self): list_1 = ["a", "b", "c"] list_2 = ["a", "b", "c"] self.assertTrue(equal(list_1, list_2)) def test_unsorted_lists(self): list_1 = ["a", "b", "c"] list_2 = ["b", "b", "a"] self.assertFalse(equal(list_1, list_2)) def test_first_list_larger(self): list_1 = ["a", "b", "c"] list_2 = ["a", "b"] self.assertFalse(equal(list_1, list_2)) def test_second_list_larger(self): list_1 = ["a", "b"] list_2 = ["a", "b", "c"] self.assertFalse(equal(list_1, list_2)) def test_list_with_none_unequal(self): list_1 = ["a", "b", None] list_2 = ["a", "b", "c"] self.assertFalse(equal(list_1, list_2)) list_1 = ["a", "b", None] list_2 = [None, "b", "c"] self.assertFalse(equal(list_1, list_2)) def test_list_with_none_equal(self): list_1 = ["a", None, "c"] list_2 = ["a", None, "c"] self.assertTrue(equal(list_1, list_2)) def test_empty_list(self): list_1 = [] list_2 = [] self.assertTrue(equal(list_1, list_2)) def test_one_none(self): list_1 = None list_2 = [] self.assertFalse(equal(list_1, list_2)) def test_same_list(self): list_1 = ["a", "b", "c"] self.assertTrue(equal(list_1, list_1)) def test_equal_nested_lists(self): list_1 = ["a", ["b", "c"], "d"] list_2 = ["a", ["b", "c"], "d"] self.assertTrue(equal(list_1, list_2)) def test_unequal_nested_lists(self): list_1 = ["a", ["b", "c"], "d"] list_2 = ["a", [], "c"] self.assertFalse(equal(list_1, list_2))
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 12
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-01-08 12:56:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
fuzz_validate.py
1.09 KB
lrw-r--r--
2023-08-14 21:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_cli.py
28.06 KB
lrw-r--r--
2023-08-14 21:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_deprecations.py
3.81 KB
lrw-r--r--
2023-08-14 21:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_exceptions.py
18.74 KB
lrw-r--r--
2023-08-14 21:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_format.py
3.67 KB
lrw-r--r--
2023-08-14 21:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_jsonschema_test_suite.py
20.70 KB
lrw-r--r--
2023-08-14 21:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_types.py
6.64 KB
lrw-r--r--
2023-08-14 21:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_utils.py
3.66 KB
lrw-r--r--
2023-08-14 21:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
test_validators.py
73.71 KB
lrw-r--r--
2023-08-14 21:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_helpers.py
623 B
lrw-r--r--
2023-08-14 21:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_suite.py
6.86 KB
lrw-r--r--
2023-08-14 21:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
0 B
lrw-r--r--
2023-08-14 21:45:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).