|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | 3 | from collections import defaultdict |
| 4 | +from datetime import datetime, timezone |
4 | 5 | import os |
5 | 6 | from pathlib import Path |
6 | 7 | from shutil import copyfile, rmtree |
@@ -631,7 +632,13 @@ def test_upload_rejects_dandidownload_paths( |
631 | 632 | # Test 1: Regular file with .dandidownload in path |
632 | 633 | badfile_path = dspath / f"test{DOWNLOAD_SUFFIX}" / "file.nwb" |
633 | 634 | 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 | + ) |
635 | 642 |
|
636 | 643 | with pytest.raises( |
637 | 644 | UploadError, |
@@ -687,7 +694,13 @@ def test_upload_rejects_dandidownload_nwb_file(new_dandiset: SampleDandiset) -> |
687 | 694 |
|
688 | 695 | # Create an NWB file with .dandidownload in its name |
689 | 696 | 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 | + ) |
691 | 704 |
|
692 | 705 | with pytest.raises( |
693 | 706 | UploadError, |
|
0 commit comments