add first series of tests
@@ -46,7 +46,7 @@ def test_describe_echo_times_smoke(testlayout):
assert isinstance(te_str, str)
-def test_describe_double_echo_times_smoke(testlayout):
+def test_describe_echo_times_fmap(testlayout):
"""Smoke test for parsing echo time
It should return a str description when provided valid inputs.
@@ -60,3 +60,72 @@ def test_describe_double_echo_times_smoke(testlayout):
te_str = parameters.describe_echo_times_fmap(fmap_file)
assert isinstance(te_str, str)
+
+
+def test_describe_repetition_time_smoke():
+
+ # given
+ metadata = {"RepetitionTime": 2}
+ # when
+ tr_str = parameters.describe_repetition_time(metadata)
+ # then
+ expected = "repetition time, TR=2000ms"
+ assert tr_str == expected
+
+
+def test_describe_func_duration_smoke():
+
+ # given
+ n_vols = 100
+ tr = 2.5
+ # when
+ duration = parameters.describe_func_duration(n_vols, tr)
+ # then
+ expected = "4:10"
+ assert duration == expected
+
+def test_describe_multiband_factor_smoke():
+
+ # given
+ metadata = {"MultibandAccelerationFactor": 2}
+ # when
+ mb_str = parameters.describe_multiband_factor(metadata)
+ # then
+ expected = "MB factor=2"
+ assert mb_str == expected
+
+ # given
+ metadata = {"RepetitionTime": 2}
+ # when
+ mb_str = parameters.describe_multiband_factor(metadata)
+ # then
+ expected = ""
+ assert mb_str == expected
+
+def test_describe_inplane_accel_smoke():
+
+ # given
+ metadata = {"ParallelReductionFactorInPlane": 2}
+ # when
+ mb_str = parameters.describe_inplane_accel(metadata)
+ # then
+ expected = "in-plane acceleration factor=2"
+ assert mb_str == expected
+
+ # given
+ metadata = {"RepetitionTime": 2}
+ # when
+ mb_str = parameters.describe_inplane_accel(metadata)
+ # then
+ expected = ""
+ assert mb_str == expected
+
+def test_describe_flip_angle_smoke():
+
+ # given
+ metadata = {"FlipAngle": 90}
+ # when
+ mb_str = parameters.describe_flip_angle(metadata)
+ # then
+ expected = "flip angle, FA=90<deg>"
+ assert mb_str == expected
\ No newline at end of file
