TEST: Restore license argument to test
@@ -18,24 +18,25 @@ def test_pass_dummy_scans(algo_dummy_scans, dummy_scans, expected_out):
@pytest.mark.parametrize(
- "stdout,rc,valid",
+ "stdout,lic,rc,valid",
[
- (b"Successful command", 0, True),
- (b"", 0, True),
- (b"ERROR: FreeSurfer license file /made/up/license.txt not found", 1, False),
- (b"Failed output", 1, False),
- (b"ERROR: Systems running GNU glibc version greater than 2.15", 0, False),
+ (b"Successful command", None, 0, True),
+ (b"Successful command", "custom/license.txt", 0, True),
+ (b"", None, 0, True),
+ (b"ERROR: FreeSurfer license file /made/up/license.txt not found", None, 1, False),
+ (b"Failed output", None, 1, False),
+ (b"ERROR: Systems running GNU glibc version greater than 2.15", None, 0, False),
],
)
-def test_fs_license_check(stdout, rc, valid):
+def test_fs_license_check(stdout, lic, rc, valid):
with mock.patch("subprocess.run") as mocked_run:
mocked_run.return_value.stdout = stdout
mocked_run.return_value.returncode = rc
- assert check_valid_fs_license() is valid
+ assert check_valid_fs_license(lic=lic) is valid
@pytest.mark.skipif(not os.getenv("FS_LICENSE"), reason="No FS license found")
-def test_fs_license_check2(monkeypatch):
+def test_fs_license_check2():
"""Execute the canary itself."""
assert check_valid_fs_license() is True
