Skip to content

Commit 115b915

Browse files
committed
gh-148954: rename test and wrap long line
1 parent 6e1f96d commit 115b915

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Lib/test/test_xmlrpc.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,14 @@ def test_dump_encoding(self):
208208
self.assertEqual(xmlrpclib.loads(strg)[0][0], value)
209209
self.assertEqual(xmlrpclib.loads(strg)[1], methodname)
210210

211-
def test_methodname_sanitization(self):
211+
def test_dump_escape_methodname(self):
212212
# gh-148954: test that methodname is sanitized in dumps()
213213
payload = 'foo</methodName><injected attr="evil"/><methodName>bar'
214214
s = xmlrpclib.dumps((), methodname=payload)
215-
self.assertIn('<methodName>foo&lt;/methodName&gt;&lt;injected attr="evil"/&gt;&lt;methodName&gt;bar</methodName>', s)
215+
self.assertIn(
216+
'<methodName>foo&lt;/methodName&gt;&lt;injected attr="evil"/&gt;'
217+
'&lt;methodName&gt;bar</methodName>', s
218+
)
216219
self.assertNotIn('<injected attr="evil"/>', s)
217220
load, m = xmlrpclib.loads(s)
218221
self.assertEqual(m, payload)

0 commit comments

Comments
 (0)