MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / test_version_mismatch

Function test_version_mismatch

tests/test_server.py:69–91  ·  view source on GitHub ↗
(hq_env: HqEnv)

Source from the content-addressed store, hash-verified

67
68
69def 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
94def test_server_info(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 4

commandMethod · 0.80
loadMethod · 0.80
start_serverMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected