diff --git a/fs/path.py b/fs/path.py index 875e536e..cf272032 100644 --- a/fs/path.py +++ b/fs/path.py @@ -437,7 +437,7 @@ def isbase(path1, path2): """ _path1 = forcedir(abspath(path1)) _path2 = forcedir(abspath(path2)) - return _path1.startswith(_path2) + return _path2.startswith(_path1) # longer one is child def isparent(path1, path2): diff --git a/tests/test_path.py b/tests/test_path.py index af39541d..6b67d2a8 100644 --- a/tests/test_path.py +++ b/tests/test_path.py @@ -146,8 +146,8 @@ def test_recursepath(self): self.assertEquals(recursepath("", reverse=True), ["/"]) def test_isbase(self): - self.assertTrue(isbase('foo/bar', 'foo')) - self.assertFalse(isbase('foo/bar', 'baz')) + self.assertTrue(isbase('foo', 'foo/bar')) + self.assertFalse(isbase('baz', 'foo/bar')) def test_isparent(self): self.assertTrue(isparent("foo/bar", "foo/bar/spam.txt"))