[ARVADOS] updated: 1.3.0-1371-g67e402475
Git user
git at public.curoverse.com
Thu Jul 18 18:52:50 UTC 2019
Summary of changes:
services/fuse/tests/test_command_args.py | 15 ++++++++-------
services/fuse/tests/test_exec.py | 4 +++-
services/fuse/tests/test_mount.py | 31 +++++++++++++++---------------
services/fuse/tests/test_tmp_collection.py | 8 +++++---
4 files changed, 32 insertions(+), 26 deletions(-)
via 67e4024755b7871b7f6dcc30ff094bb3291e1631 (commit)
from a1a1a8756149d5d05526503fd1e85115ea083fac (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 67e4024755b7871b7f6dcc30ff094bb3291e1631
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date: Thu Jul 18 14:52:45 2019 -0400
14965: Fixes assertRegexpMatch deprecation warning
Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
diff --git a/services/fuse/tests/test_command_args.py b/services/fuse/tests/test_command_args.py
index 581f24624..ed5902962 100644
--- a/services/fuse/tests/test_command_args.py
+++ b/services/fuse/tests/test_command_args.py
@@ -4,6 +4,7 @@
from __future__ import absolute_import
from __future__ import print_function
+from six import assertRegex
import arvados
import arvados_fuse
import arvados_fuse.command
@@ -82,13 +83,13 @@ class MountArgsTest(unittest.TestCase):
e = self.check_ent_type(arvados_fuse.StringFile, 'README')
readme = e.readfrom(0, -1).decode()
- self.assertRegexpMatches(readme, r'active-user at arvados\.local')
- self.assertRegexpMatches(readme, r'\n$')
+ assertRegex(self, readme, r'active-user at arvados\.local')
+ assertRegex(self, readme, r'\n$')
e = self.check_ent_type(arvados_fuse.StringFile, 'by_id', 'README')
txt = e.readfrom(0, -1).decode()
- self.assertRegexpMatches(txt, r'portable data hash')
- self.assertRegexpMatches(txt, r'\n$')
+ assertRegex(self, txt, r'portable data hash')
+ assertRegex(self, txt, r'\n$')
@noexit
def test_by_id(self):
@@ -188,8 +189,8 @@ class MountArgsTest(unittest.TestCase):
def test_version_argument(self):
# The argparse version action prints to stderr in Python 2 and stdout
- # in Python 3.4 and up. Write both to the same stream so the test can pass
- # in both cases.
+ # in Python 3.4 and up. Write both to the same stream so the test can pass
+ # in both cases.
origerr = sys.stderr
origout = sys.stdout
sys.stderr = io.StringIO()
@@ -197,7 +198,7 @@ class MountArgsTest(unittest.TestCase):
with self.assertRaises(SystemExit):
args = arvados_fuse.command.ArgumentParser().parse_args(['--version'])
- self.assertRegexpMatches(sys.stdout.getvalue(), "[0-9]+\.[0-9]+\.[0-9]+")
+ assertRegex(self, sys.stdout.getvalue(), "[0-9]+\.[0-9]+\.[0-9]+")
sys.stderr.close()
sys.stderr = origerr
sys.stdout = origout
diff --git a/services/fuse/tests/test_exec.py b/services/fuse/tests/test_exec.py
index 351960331..192b1b5dc 100644
--- a/services/fuse/tests/test_exec.py
+++ b/services/fuse/tests/test_exec.py
@@ -3,6 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0
from __future__ import absolute_import
+from six import assertRegex
import arvados_fuse.command
import json
import multiprocessing
@@ -60,6 +61,7 @@ class ExecMode(unittest.TestCase):
quote(os.path.join(self.mnt, 'zzz', '.arvados#collection')),
quote(os.path.join(self.okfile)))]))
with open(self.okfile) as f:
- self.assertRegexpMatches(
+ assertRegex(
+ self,
json.load(f)['manifest_text'],
r' 0:3:foo.txt\n')
diff --git a/services/fuse/tests/test_mount.py b/services/fuse/tests/test_mount.py
index f0d2260b5..f539b3f7d 100644
--- a/services/fuse/tests/test_mount.py
+++ b/services/fuse/tests/test_mount.py
@@ -6,6 +6,7 @@ from __future__ import absolute_import
from future.utils import viewitems
from builtins import str
from builtins import object
+from six import assertRegex
import json
import llfuse
import logging
@@ -428,7 +429,7 @@ class FuseCreateFileTest(MountTestBase):
self.assertEqual(["file1.txt"], d1)
collection2 = self.api.collections().get(uuid=collection.manifest_locator()).execute()
- self.assertRegexpMatches(collection2["manifest_text"],
+ assertRegex(self, collection2["manifest_text"],
r'\. d41d8cd98f00b204e9800998ecf8427e\+0\+A\S+ 0:0:file1\.txt$')
@@ -470,7 +471,7 @@ class FuseWriteFileTest(MountTestBase):
self.assertEqual(12, self.operations.read_counter.get())
collection2 = self.api.collections().get(uuid=collection.manifest_locator()).execute()
- self.assertRegexpMatches(collection2["manifest_text"],
+ assertRegex(self, collection2["manifest_text"],
r'\. 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file1\.txt$')
@@ -508,7 +509,7 @@ class FuseUpdateFileTest(MountTestBase):
self.pool.apply(fuseUpdateFileTestHelper, (self.mounttmp,))
collection2 = self.api.collections().get(uuid=collection.manifest_locator()).execute()
- self.assertRegexpMatches(collection2["manifest_text"],
+ assertRegex(self, collection2["manifest_text"],
r'\. daaef200ebb921e011e3ae922dd3266b\+11\+A\S+ 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:11:file1\.txt 22:1:file1\.txt$')
@@ -548,7 +549,7 @@ class FuseMkdirTest(MountTestBase):
self.pool.apply(fuseMkdirTestHelper, (self.mounttmp,))
collection2 = self.api.collections().get(uuid=collection.manifest_locator()).execute()
- self.assertRegexpMatches(collection2["manifest_text"],
+ assertRegex(self, collection2["manifest_text"],
r'\./testdir 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file1\.txt$')
@@ -615,13 +616,13 @@ class FuseRmTest(MountTestBase):
# Starting manifest
collection2 = self.api.collections().get(uuid=collection.manifest_locator()).execute()
- self.assertRegexpMatches(collection2["manifest_text"],
+ assertRegex(self, collection2["manifest_text"],
r'\./testdir 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file1\.txt$')
self.pool.apply(fuseRmTestHelperDeleteFile, (self.mounttmp,))
# Empty directories are represented by an empty file named "."
collection2 = self.api.collections().get(uuid=collection.manifest_locator()).execute()
- self.assertRegexpMatches(collection2["manifest_text"],
+ assertRegex(self, collection2["manifest_text"],
r'./testdir d41d8cd98f00b204e9800998ecf8427e\+0\+A\S+ 0:0:\\056\n')
self.pool.apply(fuseRmTestHelperRmdir, (self.mounttmp,))
@@ -672,13 +673,13 @@ class FuseMvFileTest(MountTestBase):
# Starting manifest
collection2 = self.api.collections().get(uuid=collection.manifest_locator()).execute()
- self.assertRegexpMatches(collection2["manifest_text"],
+ assertRegex(self, collection2["manifest_text"],
r'\./testdir 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file1\.txt$')
self.pool.apply(fuseMvFileTestHelperMoveFile, (self.mounttmp,))
collection2 = self.api.collections().get(uuid=collection.manifest_locator()).execute()
- self.assertRegexpMatches(collection2["manifest_text"],
+ assertRegex(self, collection2["manifest_text"],
r'\. 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file1\.txt\n\./testdir d41d8cd98f00b204e9800998ecf8427e\+0\+A\S+ 0:0:\\056\n')
@@ -706,7 +707,7 @@ class FuseRenameTest(MountTestBase):
# Starting manifest
collection2 = self.api.collections().get(uuid=collection.manifest_locator()).execute()
- self.assertRegexpMatches(collection2["manifest_text"],
+ assertRegex(self, collection2["manifest_text"],
r'\./testdir 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file1\.txt$')
d1 = llfuse.listdir(os.path.join(self.mounttmp))
@@ -722,7 +723,7 @@ class FuseRenameTest(MountTestBase):
self.assertEqual(["file1.txt"], d1)
collection2 = self.api.collections().get(uuid=collection.manifest_locator()).execute()
- self.assertRegexpMatches(collection2["manifest_text"],
+ assertRegex(self, collection2["manifest_text"],
r'\./testdir2 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file1\.txt$')
@@ -788,7 +789,7 @@ def fuseFileConflictTestHelper(mounttmp):
with open(os.path.join(mounttmp, "file1.txt"), "r") as f:
self.assertEqual(f.read(), "bar")
- self.assertRegexpMatches(d1[1],
+ assertRegex(self, d1[1],
r'file1\.txt~\d\d\d\d\d\d\d\d-\d\d\d\d\d\d~conflict~')
with open(os.path.join(mounttmp, d1[1]), "r") as f:
@@ -897,7 +898,7 @@ class FuseMvFileBetweenCollectionsTest(MountTestBase):
collection1.update()
collection2.update()
- self.assertRegexpMatches(collection1.manifest_text(), r"\. 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file1\.txt$")
+ assertRegex(self, collection1.manifest_text(), r"\. 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file1\.txt$")
self.assertEqual(collection2.manifest_text(), "")
self.pool.apply(fuseMvFileBetweenCollectionsTest2, (self.mounttmp,
@@ -908,7 +909,7 @@ class FuseMvFileBetweenCollectionsTest(MountTestBase):
collection2.update()
self.assertEqual(collection1.manifest_text(), "")
- self.assertRegexpMatches(collection2.manifest_text(), r"\. 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file2\.txt$")
+ assertRegex(self, collection2.manifest_text(), r"\. 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file2\.txt$")
collection1.stop_threads()
collection2.stop_threads()
@@ -968,7 +969,7 @@ class FuseMvDirBetweenCollectionsTest(MountTestBase):
collection1.update()
collection2.update()
- self.assertRegexpMatches(collection1.manifest_text(), r"\./testdir 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file1\.txt$")
+ assertRegex(self, collection1.manifest_text(), r"\./testdir 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file1\.txt$")
self.assertEqual(collection2.manifest_text(), "")
self.pool.apply(fuseMvDirBetweenCollectionsTest2, (self.mounttmp,
@@ -979,7 +980,7 @@ class FuseMvDirBetweenCollectionsTest(MountTestBase):
collection2.update()
self.assertEqual(collection1.manifest_text(), "")
- self.assertRegexpMatches(collection2.manifest_text(), r"\./testdir2 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file1\.txt$")
+ assertRegex(self, collection2.manifest_text(), r"\./testdir2 86fb269d190d2c85f6e0468ceca42a20\+12\+A\S+ 0:12:file1\.txt$")
collection1.stop_threads()
collection2.stop_threads()
diff --git a/services/fuse/tests/test_tmp_collection.py b/services/fuse/tests/test_tmp_collection.py
index f85cc2b38..50075c96a 100644
--- a/services/fuse/tests/test_tmp_collection.py
+++ b/services/fuse/tests/test_tmp_collection.py
@@ -3,6 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0
from builtins import range
+from six import assertRegex
import arvados
import arvados_fuse
import arvados_fuse.command
@@ -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$")
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list