Skip to content

Commit

Permalink
test AlyxClient.cache_dir setter
Browse files Browse the repository at this point in the history
  • Loading branch information
k1o0 committed Feb 15, 2023
1 parent 71cb500 commit a3f3316
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- bugfix: OneAlyx.search dataset kwarg in remote mode now matches dataset name instead of dataset type name
- warns user if downloading cache tables from a different database to the current cache tables
- possible to set the cache_dir attribute in AlyxClient
- function to print REST schemas in AlyxClient

## [1.19.1]

Expand Down
2 changes: 1 addition & 1 deletion one/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""The Open Neurophysiology Environment (ONE) API"""
__version__ = '1.19.2'
__version__ = '1.20.0'
10 changes: 10 additions & 0 deletions one/tests/test_alyxclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,16 @@ def test_no_cache_context_manager(self):
self.assertIsNone(ac.cache_mode)
self.assertIsNotNone(ac.cache_mode)

def test_cache_dir_setter(self):
"""Tests setter for AlyxClient.cache_dir attribute."""
prev_path = ac.cache_dir
try:
ac.cache_dir = prev_path / 'foobar'
self.assertEqual(ac.cache_dir, ac._par.CACHE_DIR)
self.assertTrue(str(ac.cache_dir).endswith('foobar'))
finally:
ac._par = ac._par.set('CACHE_DIR', prev_path)


if __name__ == '__main__':
unittest.main(exit=False, verbosity=2)

0 comments on commit a3f3316

Please sign in to comment.