X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/55aafbb07904ca24390dd47ea960eae7cb2b909a..1227556ee452f52b193645eeccc56f2d27412f82:/services/fuse/tests/test_token_expiry.py diff --git a/services/fuse/tests/test_token_expiry.py b/services/fuse/tests/test_token_expiry.py index 9756b2efe3..040db2e096 100644 --- a/services/fuse/tests/test_token_expiry.py +++ b/services/fuse/tests/test_token_expiry.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: AGPL-3.0 +from builtins import range import apiclient import arvados import arvados_fuse @@ -32,10 +33,10 @@ class TokenExpiryTest(IntegrationTest): def fake_open(self, operations, *args, **kwargs): self.time_now += 86400*13 logger.debug('opening file at time=%f', self.time_now) - return self.orig_open(operations, *args, **kwargs) + return TokenExpiryTest.orig_open(operations, *args, **kwargs) @mock.patch.object(arvados_fuse.Operations, 'open', autospec=True) - @mock.patch('time.time') + @mock.patch.object(time, 'time', return_value=0) @mock.patch('arvados.keep.KeepClient.get') @IntegrationTest.mount(argv=['--mount-by-id', 'zzz']) def test_refresh_old_manifest(self, mocked_get, mocked_time, mocked_open): @@ -44,7 +45,7 @@ class TokenExpiryTest(IntegrationTest): # blobSignatureTtl seconds elapse between open() and # read(). See https://dev.arvados.org/issues/10008 - mocked_get.return_value = 'fake data' + mocked_get.return_value = b'fake data' mocked_time.side_effect = self.fake_time mocked_open.side_effect = self.fake_open