Do not use translate to delete chars
In python3, str.translate() only takes one argument, we can not use it to delete specific chars. Use other method instead. Partially-Implements: blueprint magnum-python3 Change-Id: I3e1ab0969b9ef9bb8240195b8cb1496bd9bc2e4a
This commit is contained in:
parent
34608c9503
commit
581fe6a863
|
@ -68,5 +68,6 @@ class ShortIdTest(testtools.TestCase):
|
|||
|
||||
for id in ids:
|
||||
self.assertEqual(12, len(id))
|
||||
self.assertFalse(id.translate(None, allowed_chars))
|
||||
s = ''.join(ch for ch in id if ch not in allowed_chars)
|
||||
self.assertEqual(s, '')
|
||||
self.assertEqual(1, ids.count(id))
|
||||
|
|
Loading…
Reference in New Issue