Skip to content

Commit

Permalink
Bugfixes in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelzwiers committed Sep 23, 2024
1 parent 5f7dc24 commit 131f7a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_properties(self, datasource):
assert datasource.properties( 'filepath:.*/(.*?)_files/.*') == 'test' # path = [..]/pydicom/data/test_files/MR_small.dcm'
assert datasource.properties(r'filename:MR_(.*?)\.dcm') == 'small'
assert datasource.properties( 'filesize') == '9.60 kB'
assert datasource.properties( 'nrfiles') in (75,76) # Depends on the pydicom version
assert datasource.properties( 'nrfiles') in (75,76,86) # Depends on the pydicom version

def test_attributes(self, datasource, extdatasource):
assert datasource.attributes(r'PatientName:.*\^(.*?)1') == 'MR' # PatientName = 'CompressedSamples^MR1'
Expand Down Expand Up @@ -97,7 +97,7 @@ def test_dynamicvalue(self, datasource):
assert datasource.dynamicvalue(r'<0x00100010>') == 'CompressedSamplesMR1'
assert datasource.dynamicvalue(r'<0x10,0x10>') == 'CompressedSamplesMR1'
assert datasource.dynamicvalue(r'<(0x10, 0x10)>') == 'CompressedSamplesMR1'
assert datasource.dynamicvalue(r'<(0010, 0010)>') == 'CompressedSamplesMR1'
assert datasource.dynamicvalue(r'<(0010,0010)>') == 'CompressedSamplesMR1'


class TestRunItem:
Expand Down Expand Up @@ -527,7 +527,7 @@ def test_get_dicomfield(dcm_file_csa):
assert value == 12
assert value == bids.get_dicomfield('0x00200011', dcm_file_csa)
assert value == bids.get_dicomfield('(0x20,0x11)', dcm_file_csa)
assert value == bids.get_dicomfield('(0020, 0011)', dcm_file_csa)
assert value == bids.get_dicomfield('(0020,0011)', dcm_file_csa)

# -> The special PhaseEncodingDirection tag
value = bids.get_dicomfield('PhaseEncodingDirection', dcm_file_csa)
Expand Down Expand Up @@ -677,7 +677,7 @@ def test_updatemetadata(dcm_file, tmp_path):

# Create the user metadata
usermeta = Meta({'PatientName': 'UserTest',
'DynamicName': '<<(0010, 0010)>>',
'DynamicName': '<<(0010,0010)>>',
'B0FieldSource': 'Source<<session:[-2:2]>>',
'B0FieldIdentifier': ['Identifier<<session>>', 'Identifier']})

Expand Down

0 comments on commit 131f7a1

Please sign in to comment.