Skip to content

Add unit tests for _resolve_external_table#1543

Draft
Copilot wants to merge 2 commits intochecksum_fixfrom
copilot/sub-pr-1536
Draft

Add unit tests for _resolve_external_table#1543
Copilot wants to merge 2 commits intochecksum_fixfrom
copilot/sub-pr-1536

Conversation

Copy link
Contributor

Copilot AI commented Feb 25, 2026

Adds test coverage for _resolve_external_table in tests/utils/test_dj_helper_fn.py, which previously had none despite handling critical external table updates (related to #1535).

Changes

  • tests/utils/test_dj_helper_fn.py: 7 unit tests covering both location="analysis" and location="raw" branches, including:
    • Empty match → warning logged
    • Multiple matches → ValueError raised
    • Single match → update1 called with updated size and contents_hash
    • Mixed empty/non-empty analysis externals → only matching external updated

All tests use unittest.mock.patch to mock LabMember, AnalysisRegistry, schema, Path, and dj—no database or real file I/O required.

Checklist:

  • N/A. If this PR should be accompanied by a release, I have updated the CITATION.cff
  • N/A. If this PR edits table definitions, I have included an alter snippet for release notes.
  • N/A. If this PR makes changes to position, I ran the relevant tests locally.
  • N/A. If this PR makes user-facing changes, I have added/edited docs/notebooks to reflect the changes
  • I have updated the CHANGELOG.md with PR number and description.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: samuelbray32 <24991442+samuelbray32@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback on updates to unrestricted external tables Add unit tests for _resolve_external_table Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants