@@ -168,7 +168,7 @@ def test_glob_exists(self):
168
168
self .assertFalse (files .glob_exists (3 ))
169
169
self .assertFalse (files .glob_exists (1 ))
170
170
171
- def assertRegexpMatches (self , text , expected_regexp , msg = None ):
171
+ def assertRegex (self , text , expected_regexp , msg = None ):
172
172
"""Python 2.7 backport."""
173
173
if isinstance (expected_regexp , str ):
174
174
expected_regexp = re .compile (expected_regexp )
@@ -201,21 +201,21 @@ def test_tmppath_not_configured(self):
201
201
res9 = hdfs .tmppath (path9 , include_unix_username = False )
202
202
203
203
# Then: I should get correct results relative to Luigi temporary directory
204
- self .assertRegexpMatches (res1 , "^/tmp/dir1/dir2/file-luigitemp-\\ d+" )
204
+ self .assertRegex (res1 , "^/tmp/dir1/dir2/file-luigitemp-\\ d+" )
205
205
# it would be better to see hdfs:///path instead of hdfs:/path, but single slash also works well
206
- self .assertRegexpMatches (res2 , "^hdfs:/tmp/dir1/dir2/file-luigitemp-\\ d+" )
207
- self .assertRegexpMatches (res3 , "^hdfs://somehost/tmp/dir1/dir2/file-luigitemp-\\ d+" )
208
- self .assertRegexpMatches (res4 , "^file:///tmp/dir1/dir2/file-luigitemp-\\ d+" )
209
- self .assertRegexpMatches (res5 , "^/tmp/dir/file-luigitemp-\\ d+" )
206
+ self .assertRegex (res2 , "^hdfs:/tmp/dir1/dir2/file-luigitemp-\\ d+" )
207
+ self .assertRegex (res3 , "^hdfs://somehost/tmp/dir1/dir2/file-luigitemp-\\ d+" )
208
+ self .assertRegex (res4 , "^file:///tmp/dir1/dir2/file-luigitemp-\\ d+" )
209
+ self .assertRegex (res5 , "^/tmp/dir/file-luigitemp-\\ d+" )
210
210
# known issue with duplicated "tmp" if schema is present
211
- self .assertRegexpMatches (res6 , "^file:///tmp/tmp/dir/file-luigitemp-\\ d+" )
211
+ self .assertRegex (res6 , "^file:///tmp/tmp/dir/file-luigitemp-\\ d+" )
212
212
# known issue with duplicated "tmp" if schema is present
213
- self .assertRegexpMatches (res7 , "^hdfs://somehost/tmp/tmp/dir/file-luigitemp-\\ d+" )
214
- self .assertRegexpMatches (res8 , "^/tmp/luigitemp-\\ d+" )
215
- self .assertRegexpMatches (res9 , "/tmp/tmpdir/file" )
213
+ self .assertRegex (res7 , "^hdfs://somehost/tmp/tmp/dir/file-luigitemp-\\ d+" )
214
+ self .assertRegex (res8 , "^/tmp/luigitemp-\\ d+" )
215
+ self .assertRegex (res9 , "/tmp/tmpdir/file" )
216
216
217
217
def test_tmppath_username (self ):
218
- self .assertRegexpMatches (hdfs .tmppath ('/path/to/stuff' , include_unix_username = True ),
218
+ self .assertRegex (hdfs .tmppath ('/path/to/stuff' , include_unix_username = True ),
219
219
"^/tmp/[a-z0-9_]+/path/to/stuff-luigitemp-\\ d+" )
220
220
221
221
def test_pickle (self ):
0 commit comments