Skip to content

Commit

Permalink
tests(json): Fix tests failing because of dictionary key order
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeSavefrogs committed Jan 17, 2024
1 parent ff6d938 commit b4d3632
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/polyfills/json/tests/dumps/test_dumps.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,24 @@ def test_simple(self):

def test_conversion_keys(self):
self.assertEqual(
json.dumps({True: 1, False: 0, None: "null"}),
'{"true": 1, "false": 0, "null": "null"}'
json.dumps({True: 1}),
'{"true": 1}',
)
self.assertEqual(
json.dumps({False: 0}),
'{"false": 0}',
)
self.assertEqual(
json.dumps({None: None}),
'{"null": null}',
)
self.assertEqual(
json.dumps({1: 1}),
'{"1": 1}',
)
self.assertEqual(
json.dumps({1.1: 1.1}),
'{"1.1": 1.1}',
)

def test_quotes(self):
Expand Down

0 comments on commit b4d3632

Please sign in to comment.