summaryrefslogtreecommitdiffstats
path: root/Lib/json/tests/test_unicode.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/json/tests/test_unicode.py')
-rw-r--r--Lib/json/tests/test_unicode.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/Lib/json/tests/test_unicode.py b/Lib/json/tests/test_unicode.py
index 12de83c..e336c91 100644
--- a/Lib/json/tests/test_unicode.py
+++ b/Lib/json/tests/test_unicode.py
@@ -10,43 +10,43 @@ class TestUnicode(TestCase):
def test_encoding3(self):
u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
j = json.dumps(u)
- self.assertEquals(j, '"\\u03b1\\u03a9"')
+ self.assertEqual(j, '"\\u03b1\\u03a9"')
def test_encoding4(self):
u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
j = json.dumps([u])
- self.assertEquals(j, '["\\u03b1\\u03a9"]')
+ self.assertEqual(j, '["\\u03b1\\u03a9"]')
def test_encoding5(self):
u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
j = json.dumps(u, ensure_ascii=False)
- self.assertEquals(j, '"{0}"'.format(u))
+ self.assertEqual(j, '"{0}"'.format(u))
def test_encoding6(self):
u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
j = json.dumps([u], ensure_ascii=False)
- self.assertEquals(j, '["{0}"]'.format(u))
+ self.assertEqual(j, '["{0}"]'.format(u))
def test_big_unicode_encode(self):
u = '\U0001d120'
- self.assertEquals(json.dumps(u), '"\\ud834\\udd20"')
- self.assertEquals(json.dumps(u, ensure_ascii=False), '"\U0001d120"')
+ self.assertEqual(json.dumps(u), '"\\ud834\\udd20"')
+ self.assertEqual(json.dumps(u, ensure_ascii=False), '"\U0001d120"')
def test_big_unicode_decode(self):
u = 'z\U0001d120x'
- self.assertEquals(json.loads('"' + u + '"'), u)
- self.assertEquals(json.loads('"z\\ud834\\udd20x"'), u)
+ self.assertEqual(json.loads('"' + u + '"'), u)
+ self.assertEqual(json.loads('"z\\ud834\\udd20x"'), u)
def test_unicode_decode(self):
for i in range(0, 0xd7ff):
u = chr(i)
s = '"\\u{0:04x}"'.format(i)
- self.assertEquals(json.loads(s), u)
+ self.assertEqual(json.loads(s), u)
def test_unicode_preservation(self):
- self.assertEquals(type(json.loads('""')), str)
- self.assertEquals(type(json.loads('"a"')), str)
- self.assertEquals(type(json.loads('["a"]')[0]), str)
+ self.assertEqual(type(json.loads('""')), str)
+ self.assertEqual(type(json.loads('"a"')), str)
+ self.assertEqual(type(json.loads('["a"]')[0]), str)
def test_bytes_encode(self):
self.assertRaises(TypeError, json.dumps, b"hi")