X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0561bd0c3c07257fd58ded6c7cfa5feeae97af57..a5b7b00aff9debab6607afb09b387de627bc2603:/services/fuse/tests/test_tmp_collection.py diff --git a/services/fuse/tests/test_tmp_collection.py b/services/fuse/tests/test_tmp_collection.py index b8e064615b..50075c96ae 100644 --- a/services/fuse/tests/test_tmp_collection.py +++ b/services/fuse/tests/test_tmp_collection.py @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: AGPL-3.0 +from builtins import range +from six import assertRegex import arvados import arvados_fuse import arvados_fuse.command @@ -53,9 +55,8 @@ class TmpCollectionArgsTest(unittest.TestCase): def current_manifest(tmpdir): - return json.load(open( - os.path.join(tmpdir, '.arvados#collection') - ))['manifest_text'] + with open(os.path.join(tmpdir, '.arvados#collection')) as tmp: + return json.load(tmp)['manifest_text'] class TmpCollectionTest(IntegrationTest): @@ -96,7 +97,8 @@ class TmpCollectionTest(IntegrationTest): def _test_tmp_onefile(self, tmpdir): with open(os.path.join(tmpdir, 'foo'), 'w') as f: f.write('foo') - self.assertRegexpMatches( + assertRegex( + self, current_manifest(tmpdir), r'^\. acbd18db4cc2f85cedef654fccc4a4d8\+3(\+\S+)? 0:3:foo\n$') @@ -125,7 +127,7 @@ class TmpCollectionTest(IntegrationTest): else: with open(path, 'w') as f: f.write(content) - self.assertRegexpMatches(current_manifest(tmpdir), expect) + assertRegex(self, current_manifest(tmpdir), expect) @IntegrationTest.mount(argv=mnt_args) def test_tmp_rewrite(self): @@ -138,4 +140,4 @@ class TmpCollectionTest(IntegrationTest): f.write("b2") with open(os.path.join(tmpdir, "b1"), 'w') as f: f.write("1b") - self.assertRegexpMatches(current_manifest(tmpdir), "^\. ed4f3f67c70b02b29c50ce1ea26666bd\+4(\+\S+)? 0:2:b1 2:2:b2\n$") + assertRegex(self, current_manifest(tmpdir), "^\. ed4f3f67c70b02b29c50ce1ea26666bd\+4(\+\S+)? 0:2:b1 2:2:b2\n$")