Skip to content

Commit 8aeb6a0

Browse files
committed
Fix up creation of a test nwb file for upload
1 parent 88e096e commit 8aeb6a0

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

dandi/tests/test_upload.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
from collections import defaultdict
4+
from datetime import datetime, timezone
45
import os
56
from pathlib import Path
67
from shutil import copyfile, rmtree
@@ -631,7 +632,13 @@ def test_upload_rejects_dandidownload_paths(
631632
# Test 1: Regular file with .dandidownload in path
632633
badfile_path = dspath / f"test{DOWNLOAD_SUFFIX}" / "file.nwb"
633634
badfile_path.parent.mkdir(parents=True)
634-
make_nwb_file(badfile_path, subject_id="test")
635+
make_nwb_file(
636+
badfile_path,
637+
session_description="test session",
638+
identifier="test123",
639+
session_start_time=datetime(2017, 4, 15, 12, tzinfo=timezone.utc),
640+
subject=pynwb.file.Subject(subject_id="test"),
641+
)
635642

636643
with pytest.raises(
637644
UploadError,
@@ -687,7 +694,13 @@ def test_upload_rejects_dandidownload_nwb_file(new_dandiset: SampleDandiset) ->
687694

688695
# Create an NWB file with .dandidownload in its name
689696
bad_nwb_path = dspath / f"test{DOWNLOAD_SUFFIX}.nwb"
690-
make_nwb_file(bad_nwb_path, subject_id="test")
697+
make_nwb_file(
698+
bad_nwb_path,
699+
session_description="test session",
700+
identifier="test456",
701+
session_start_time=datetime(2017, 4, 15, 12, tzinfo=timezone.utc),
702+
subject=pynwb.file.Subject(subject_id="test"),
703+
)
691704

692705
with pytest.raises(
693706
UploadError,

0 commit comments

Comments
 (0)