(hq_env: HqEnv)
| 67 | |
| 68 | |
| 69 | def test_version_mismatch(hq_env: HqEnv): |
| 70 | hq_env.start_server() |
| 71 | hq_env.command(["job", "list"], as_table=True) |
| 72 | |
| 73 | access_file = os.path.join(hq_env.server_dir, "hq-current", "access.json") |
| 74 | |
| 75 | with open(access_file) as f: |
| 76 | data = json.load(f) |
| 77 | |
| 78 | version = data["version"] |
| 79 | data["version"] += ".1" |
| 80 | |
| 81 | # Make the file writable |
| 82 | os.chmod(access_file, 0o600) |
| 83 | |
| 84 | with open(access_file, "w") as f: |
| 85 | json.dump(data, f) |
| 86 | |
| 87 | with pytest.raises( |
| 88 | Exception, |
| 89 | match=f"Access record contains version {version}.1, but the current version is {version}", |
| 90 | ): |
| 91 | hq_env.command(["job", "list"], as_table=True) |
| 92 | |
| 93 | |
| 94 | def test_server_info(hq_env: HqEnv): |
nothing calls this directly
no test coverage detected