-
Notifications
You must be signed in to change notification settings - Fork 52
Add integration tests for mass_nifti_pic.py #1274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cmadjar
merged 17 commits into
aces:main
from
cmadjar:add_integration_test_for_run_nifti_pic
Apr 24, 2025
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3a78127
add tests for mass_nifti_pic.py
cmadjar 18c30f0
fix some tests
cmadjar adb9951
fix some tests
cmadjar 4556a36
fix some tests
cmadjar 1068fc3
fix some tests
cmadjar 0b7f0b0
fix some tests
cmadjar 07b2c87
fix some tests
cmadjar c9d944e
fix some tests
cmadjar 0aed7d4
fix some tests
cmadjar 4453200
fix some tests
cmadjar 4bca159
fix some tests
cmadjar 3d12c9e
fix some tests
cmadjar 8add2ba
fix some tests
cmadjar 82edc1c
fix some tests
cmadjar 65aa621
fix some tests
cmadjar bb00d45
Maxime's feedback
cmadjar 9ec9c4a
wake up Cecile, wake up :)
cmadjar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from sqlalchemy import delete, select | ||
from sqlalchemy.orm import Session as Database | ||
|
||
from lib.db.models.file_parameter import DbFileParameter | ||
from lib.db.models.parameter_type import DbParameterType | ||
|
||
|
||
def delete_file_parameter(db: Database, file_parameter_id: int): | ||
""" | ||
Delete from the database a parameter value based on a file ID and parameter ID. | ||
""" | ||
|
||
db.execute(delete(DbFileParameter) | ||
.where(DbFileParameter.id == file_parameter_id)) | ||
|
||
|
||
def try_get_parameter_value_with_file_id_parameter_name( | ||
db: Database, | ||
file_id: int, | ||
parameter_name: str | ||
) -> DbFileParameter | None: | ||
""" | ||
Get parameter value from file ID and parameter name, or return `None` if no entry was found | ||
""" | ||
|
||
return db.execute(select(DbFileParameter) | ||
.join(DbFileParameter.type) | ||
.where(DbParameterType.name == parameter_name) | ||
.where(DbFileParameter.file_id == file_id) | ||
).scalar_one_or_none() |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.