Skip to content

Commit

Permalink
Use assert_has_calls for compatibility with Python 3.5 in fs.wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Mar 26, 2021
1 parent eb59e5d commit f7a5f7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def test_scandir(self):
]
with mock.patch.object(self.fs, "scandir", wraps=self.fs.scandir) as scandir:
self.assertEqual(sorted(self.cached.scandir("/"), key=key), expected)
scandir.assert_called()
scandir.assert_has_calls([mock.call('/', namespaces=None, page=None)])
with mock.patch.object(self.fs, "scandir", wraps=self.fs.scandir) as scandir:
self.assertEqual(sorted(self.cached.scandir("/"), key=key), expected)
scandir.assert_not_called()
Expand All @@ -187,7 +187,7 @@ def test_isdir(self):
self.assertTrue(self.cached.isdir("foo"))
self.assertFalse(self.cached.isdir("egg")) # is file
self.assertFalse(self.cached.isdir("spam")) # doesn't exist
scandir.assert_called()
scandir.assert_has_calls([mock.call('/', namespaces=None, page=None)])
with mock.patch.object(self.fs, "scandir", wraps=self.fs.scandir) as scandir:
self.assertTrue(self.cached.isdir("foo"))
self.assertFalse(self.cached.isdir("egg"))
Expand Down

0 comments on commit f7a5f7b

Please sign in to comment.