MCPcopy Create free account
hub / github.com/AI45Lab/Code / remote_git_attaches_on_top_of_s3_backend

Function remote_git_attaches_on_top_of_s3_backend

sdk/python/src/lib.rs:7203–7247  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7201
7202 #[test]
7203 fn remote_git_attaches_on_top_of_s3_backend() {
7204 pyo3::prepare_freethreaded_python();
7205 let opts = Python::with_gil(|py| {
7206 let backend = Py::new(
7207 py,
7208 PyS3WorkspaceBackend {
7209 bucket: "workspace".to_string(),
7210 prefix: "u1/s1".to_string(),
7211 access_key_id: "AKIA".to_string(),
7212 secret_access_key: "secret".to_string(),
7213 endpoint: None,
7214 region: None,
7215 session_token: None,
7216 force_path_style: false,
7217 max_read_bytes: None,
7218 search_enabled: false,
7219 max_objects_scanned: None,
7220 max_grep_bytes_per_object: None,
7221 search_concurrency: None,
7222 },
7223 )
7224 .unwrap();
7225 let mut session_options = PySessionOptions::new();
7226 session_options.workspace_backend = Some(backend.into_any());
7227 session_options.remote_git = Some(PyRemoteGitBackendConfig {
7228 base_url: "https://gitserver.internal".to_string(),
7229 repo_id: "u1/s1".to_string(),
7230 bearer_token: Some("tok".to_string()),
7231 client_cert_pem: None,
7232 client_key_pem: None,
7233 request_timeout_ms: Some(10_000),
7234 max_diff_bytes: None,
7235 max_log_entries: None,
7236 });
7237 build_rust_session_options(session_options)
7238 })
7239 .unwrap();
7240
7241 let services = opts.workspace_services.expect("services built");
7242 assert!(services.git().is_some());
7243 assert!(services.git_stash().is_some());
7244 // Worktree intentionally unavailable on remote-git workspaces (RFC §8).
7245 assert!(services.git_worktree().is_none());
7246 assert!(services.capabilities().git);
7247 }
7248
7249 /// Phase 8 alignment: a typed `ToolErrorKind` from the Rust core
7250 /// must arrive at the Python SDK as a JSON envelope on

Callers

nothing calls this directly

Calls 2

expectMethod · 0.80

Tested by

no test coverage detected