MCPcopy
hub / github.com/django/django / test_equal

Method test_equal

tests/utils_tests/test_hashable.py:6–20  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4
5class TestHashable(SimpleTestCase):
6 def test_equal(self):
7 tests = (
8 ([], ()),
9 (["a", 1], ("a", 1)),
10 ({}, ()),
11 ({"a"}, ("a",)),
12 (frozenset({"a"}), {"a"}),
13 ({"a": 1, "b": 2}, (("a", 1), ("b", 2))),
14 ({"b": 2, "a": 1}, (("a", 1), ("b", 2))),
15 (("a", ["b", 1]), ("a", ("b", 1))),
16 (("a", {"b": 1}), ("a", (("b", 1),))),
17 )
18 for value, expected in tests:
19 with self.subTest(value=value):
20 self.assertEqual(make_hashable(value), expected)
21
22 def test_count_equal(self):
23 tests = (

Callers

nothing calls this directly

Calls 1

make_hashableFunction · 0.90

Tested by

no test coverage detected