Skip to content

Commit d40b3d7

Browse files
committed
Mock AlyxClient.get method in OneAlyx.load_cache test
1 parent d57bf05 commit d40b3d7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

one/tests/test_one.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,11 +1403,14 @@ def test_load_cache(self):
14031403

14041404
# Check table_dir behaviour
14051405
prev_loc = self.one._tables_dir # should be same location as previous
1406-
with mock.patch.object(self.one.alyx, 'download_cache_tables', return_value=files):
1406+
del cache_info['database_tags']
1407+
with mock.patch.object(self.one.alyx, 'download_cache_tables', return_value=files), \
1408+
mock.patch.object(self.one.alyx, 'get', return_value=cache_info):
14071409
self.one.load_cache(clobber=True)
14081410
self.assertEqual(prev_loc, self.one._tables_dir)
14091411
new_loc = prev_loc.parent # user input should override default
1410-
with mock.patch.object(self.one.alyx, 'download_cache_tables', return_value=files):
1412+
with mock.patch.object(self.one.alyx, 'download_cache_tables', return_value=files), \
1413+
mock.patch.object(self.one.alyx, 'get', return_value=cache_info):
14111414
self.one.load_cache(tables_dir=new_loc, clobber=True)
14121415
self.assertEqual(new_loc, self.one._tables_dir)
14131416

0 commit comments

Comments
 (0)