MCPcopy Create free account
hub / github.com/simplejson/simplejson / test_string_keys_error

Method test_string_keys_error

simplejson/tests/test_errors.py:9–18  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7
8class TestErrors(TestCase):
9 def test_string_keys_error(self):
10 data = [{'a': 'A', 'b': (2, 4), 'c': 3.0, ('d',): 'D tuple'}]
11 try:
12 json.dumps(data)
13 except TypeError:
14 err = sys.exc_info()[1]
15 else:
16 self.fail('Expected TypeError')
17 self.assertEqual(str(err),
18 'keys must be str, int, float, bool or None, not tuple')
19
20 def test_not_serializable(self):
21 try:

Callers

nothing calls this directly

Calls 1

dumpsMethod · 0.80

Tested by

no test coverage detected