MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / main

Function main

tests/windows/test_windows_update_handoff.py:184–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

182
183
184def main():
185 if os.name != "nt":
186 print("PRECONDITION: native Windows is required")
187 return 2
188 if len(sys.argv) != 2:
189 print("usage: python test_windows_update_handoff.py <codebase-memory-mcp.exe>")
190 return 2
191
192 source = pathlib.Path(sys.argv[1]).resolve()
193 if not source.is_file():
194 print("PRECONDITION: binary not found: %s" % source)
195 return 2
196
197 work = pathlib.Path(tempfile.mkdtemp(prefix="cbm_win_update_"))
198 try:
199 env, cache = isolated_environment(work)
200 assert_update_hands_off_to_install_script(source, env, work)
201 assert_update_does_not_drain_active_session(source, env, cache, work)
202 print("\nGREEN: Windows update handoff contract honored.")
203 return 0
204 except (GuardFailure, McpError, OSError, subprocess.SubprocessError) as exc:
205 print("\nRED: %s" % exc)
206 return 1
207 finally:
208 shutil.rmtree(work, ignore_errors=True)
209
210
211if __name__ == "__main__":

Callers 1

Tested by

no test coverage detected