trivial: Replace assertRegexpMatches with assertRegex
Change-Id: Id1ee51fea6b754042ebe5204517dd91865ffbc28
This commit is contained in:
parent
1e410347f0
commit
57e41685ba
@ -46,6 +46,7 @@ warnings.filterwarnings('ignore', module='cryptography|OpenSSL', message=(
|
|||||||
if sys.version_info < (3, 2):
|
if sys.version_info < (3, 2):
|
||||||
import unittest
|
import unittest
|
||||||
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
||||||
|
unittest.TestCase.assertRegex = unittest.TestCase.assertRegexpMatches
|
||||||
|
|
||||||
from eventlet.green import socket
|
from eventlet.green import socket
|
||||||
|
|
||||||
|
@ -450,7 +450,7 @@ class TestS3ApiMultiUpload(S3ApiBase):
|
|||||||
o = resp_objects[0]
|
o = resp_objects[0]
|
||||||
self.assertEqual(o.find('Key').text, keys[0])
|
self.assertEqual(o.find('Key').text, keys[0])
|
||||||
self.assertIsNotNone(o.find('LastModified').text)
|
self.assertIsNotNone(o.find('LastModified').text)
|
||||||
self.assertRegexpMatches(
|
self.assertRegex(
|
||||||
o.find('LastModified').text,
|
o.find('LastModified').text,
|
||||||
r'^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$')
|
r'^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$')
|
||||||
self.assertEqual(o.find('ETag').text, exp_etag)
|
self.assertEqual(o.find('ETag').text, exp_etag)
|
||||||
|
@ -90,7 +90,7 @@ class TestS3ApiPresignedUrls(S3ApiBase):
|
|||||||
for o in resp_objects:
|
for o in resp_objects:
|
||||||
self.assertIn(o.find('Key').text, req_objects)
|
self.assertIn(o.find('Key').text, req_objects)
|
||||||
self.assertIsNotNone(o.find('LastModified').text)
|
self.assertIsNotNone(o.find('LastModified').text)
|
||||||
self.assertRegexpMatches(
|
self.assertRegex(
|
||||||
o.find('LastModified').text,
|
o.find('LastModified').text,
|
||||||
r'^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$')
|
r'^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$')
|
||||||
self.assertIsNotNone(o.find('ETag').text)
|
self.assertIsNotNone(o.find('ETag').text)
|
||||||
|
@ -382,7 +382,7 @@ class TestReceiver(unittest.TestCase):
|
|||||||
body_lines1,
|
body_lines1,
|
||||||
[b':MISSING_CHECK: START', b':MISSING_CHECK: END',
|
[b':MISSING_CHECK: START', b':MISSING_CHECK: END',
|
||||||
b':UPDATES: START', b':UPDATES: END'])
|
b':UPDATES: START', b':UPDATES: END'])
|
||||||
self.assertRegexpMatches(
|
self.assertRegex(
|
||||||
b''.join(body_lines2),
|
b''.join(body_lines2),
|
||||||
br"^:ERROR: 0 '0\.0[0-9]+ seconds: "
|
br"^:ERROR: 0 '0\.0[0-9]+ seconds: "
|
||||||
br"/.+/sda1/objects/1/.lock-replication'$")
|
br"/.+/sda1/objects/1/.lock-replication'$")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user