Skip to content

Commit

Permalink
fix test deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Sep 7, 2019
1 parent c7aaf7a commit 3c3c45c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion fs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ def test_remove(self):
self.fs.makedirs("foo/bar/baz/")

error_msg = "resource 'foo/bar/egg/test.txt' not found"
with self.assertRaisesRegexp(errors.ResourceNotFound, error_msg):
with self.assertRaisesRegex(errors.ResourceNotFound, error_msg):
self.fs.remove("foo/bar/egg/test.txt")

def test_removedir(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from fs import errors


class TestFS(FS):
class DummyFS(FS):
def getinfo(self, path, namespaces=None):
pass

Expand All @@ -33,7 +33,7 @@ def setinfo(self, path, info):

class TestBase(unittest.TestCase):
def setUp(self):
self.fs = TestFS()
self.fs = DummyFS()

def test_validatepath(self):
"""Test validatepath method."""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_iotools.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_make_stream(self):

with self.fs.openbin("foo.bin") as f:
data = f.read()
self.assert_(isinstance(data, bytes))
self.assertTrue(isinstance(data, bytes))

with self.fs.openbin("text.txt", "wb") as f:
f.write(UNICODE_TEXT.encode("utf-8"))
Expand Down
22 changes: 11 additions & 11 deletions tests/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ def test_splitext(self):
self.assertEqual(splitext(".foo"), (".foo", ""))

def test_recursepath(self):
self.assertEquals(recursepath("/"), ["/"])
self.assertEquals(recursepath("hello"), ["/", "/hello"])
self.assertEquals(recursepath("/hello/world/"), ["/", "/hello", "/hello/world"])
self.assertEquals(
self.assertEqual(recursepath("/"), ["/"])
self.assertEqual(recursepath("hello"), ["/", "/hello"])
self.assertEqual(recursepath("/hello/world/"), ["/", "/hello", "/hello/world"])
self.assertEqual(
recursepath("/hello/world/", reverse=True), ["/hello/world", "/hello", "/"]
)
self.assertEquals(recursepath("hello", reverse=True), ["/hello", "/"])
self.assertEquals(recursepath("", reverse=True), ["/"])
self.assertEqual(recursepath("hello", reverse=True), ["/hello", "/"])
self.assertEqual(recursepath("", reverse=True), ["/"])

def test_isbase(self):
self.assertTrue(isbase("foo", "foo/bar"))
Expand All @@ -178,7 +178,7 @@ def test_issamedir(self):

def test_isdotfile(self):
for path in [".foo", ".svn", "foo/.svn", "foo/bar/.svn", "/foo/.bar"]:
self.assert_(isdotfile(path))
self.assertTrue(isdotfile(path))

for path in ["asfoo", "df.svn", "foo/er.svn", "foo/bar/test.txt", "/foo/bar"]:
self.assertFalse(isdotfile(path))
Expand All @@ -201,10 +201,10 @@ def test_basename(self):
self.assertEqual(basename(path), test_basename)

def test_iswildcard(self):
self.assert_(iswildcard("*"))
self.assert_(iswildcard("*.jpg"))
self.assert_(iswildcard("foo/*"))
self.assert_(iswildcard("foo/{}"))
self.assertTrue(iswildcard("*"))
self.assertTrue(iswildcard("*.jpg"))
self.assertTrue(iswildcard("foo/*"))
self.assertTrue(iswildcard("foo/{}"))
self.assertFalse(iswildcard("foo"))
self.assertFalse(iswildcard("img.jpg"))
self.assertFalse(iswildcard("foo/bar"))
Expand Down

0 comments on commit 3c3c45c

Please sign in to comment.