Skip to content

Commit

Permalink
Minor test improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
k1o0 committed Nov 15, 2024
1 parent a0f5ba5 commit 78d347e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions alyx/data/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,14 @@ def setUp(self):
for i, repo in enumerate((repo1, repo2, repo3, repo_main)):
if repo.globus_is_personal is False:
rel_path = f'{session}/{TestManagementFiles._dataset_uuid_name(d)}'
if i == 0:
rel_path = 'Data2/' + rel_path
if i == 1:
rel_path = '/' + rel_path
elif repo.lab != d.session.lab:
continue # Don't create file record for dataset if session lab different
else:
rel_path = f'{session}/{d.name}'
if i == 0:
rel_path = 'Data2/' + rel_path
if i == 1:
rel_path = '/' + rel_path
self.records.append(
FileRecord.objects.create(
relative_path=rel_path, exists=True, dataset=d, data_repository=repo)
Expand All @@ -280,7 +280,7 @@ def test_get_name_collection_revision(self):
expected = {
'lab': '', 'subject': 'subject', 'date': '2020-01-01', 'number': '001',
'collection': '', 'revision': '', 'filename': 'ephysData.raw.ap.bin',
'full_path': 'subject/2020-01-01/001/ephysData.raw.ap.bin',
'full_path': 'Data2/subject/2020-01-01/001/ephysData.raw.ap.bin',
'rel_dir_path': 'subject/2020-01-01/001'}
self.assertDictEqual(info, expected)
relative_path = relative_path.parent / 'alf' / '#2020-10-01#' / relative_path.name
Expand Down
2 changes: 1 addition & 1 deletion alyx/jobs/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,5 @@ def test_cleanup(self):

# Error handling
self.assertRaises(ValueError, self.command.handle, action='cleanup', status='NotAStatus')
self.assertRaises(ValueError, self.command.handle, action='cleanup', status='-1000')
self.assertRaises(ValueError, self.command.handle, action='cleanup', status='1000')
self.assertRaises(ValueError, self.command.handle, action='NotAnAction')

0 comments on commit 78d347e

Please sign in to comment.