From 655eaf49e8d4c5c6653cc497490e20578ef270b2 Mon Sep 17 00:00:00 2001 From: Alexandre D'Astous Date: Thu, 25 Jan 2024 14:37:44 -0500 Subject: [PATCH] Add more robust test for absolute output format --- test/cli/test_cli_b0shim.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/cli/test_cli_b0shim.py b/test/cli/test_cli_b0shim.py index fb30cb4b..a315abbd 100644 --- a/test/cli/test_cli_b0shim.py +++ b/test/cli/test_cli_b0shim.py @@ -449,13 +449,19 @@ def test_cli_dynamic_absolute(self, nii_fmap, nii_anat, nii_mask, fm_data, anat_ '--fmap', fname_fmap, '--anat', fname_anat, '--mask', fname_mask, - '--scanner-coil-order', '2', + '--scanner-coil-order', '0, 2', '--output-value-format', 'absolute', '--output', tmp], catch_exceptions=False) assert res.exit_code == 0 assert os.path.isfile(os.path.join(tmp, "coefs_coil0_Prisma_fit.txt")) + with open(os.path.join(tmp, "coefs_coil0_Prisma_fit.txt"), 'r') as file: + lines = file.readlines() + line = lines[8].strip().split(',') + values = [float(val) for val in line if val.strip()] + + assert values == [123259067.330864, -718.069583, 138.656751, -110.517759, 24.97596, -4.888655] def test_cli_2d_fmap(self, nii_fmap, nii_anat, nii_mask, fm_data, anat_data):