MCPcopy Index your code
hub / github.com/AI45Lab/Code / workspace_services_disable_exec_without_runner

Function workspace_services_disable_exec_without_runner

core/src/workspace/mod.rs:1023–1061  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1021
1022 #[test]
1023 fn workspace_services_disable_exec_without_runner() {
1024 struct EmptyFs;
1025
1026 #[async_trait]
1027 impl WorkspaceFileSystem for EmptyFs {
1028 async fn read_text(&self, _path: &WorkspacePath) -> WorkspaceResult<String> {
1029 Err(WorkspaceError::Unsupported("not implemented".into()))
1030 }
1031
1032 async fn write_text(
1033 &self,
1034 _path: &WorkspacePath,
1035 _content: &str,
1036 ) -> WorkspaceResult<WorkspaceWriteOutcome> {
1037 Err(WorkspaceError::Unsupported("not implemented".into()))
1038 }
1039
1040 async fn list_dir(
1041 &self,
1042 _path: &WorkspacePath,
1043 ) -> WorkspaceResult<Vec<WorkspaceDirEntry>> {
1044 Err(WorkspaceError::Unsupported("not implemented".into()))
1045 }
1046 }
1047
1048 let fs_backend: Arc<dyn WorkspaceFileSystem> = Arc::new(EmptyFs);
1049 let services = WorkspaceServices::builder(
1050 WorkspaceRef::new("virtual", "virtual://workspace"),
1051 fs_backend,
1052 )
1053 .capabilities(WorkspaceCapabilities {
1054 exec: true,
1055 ..WorkspaceCapabilities::read_write()
1056 })
1057 .build();
1058
1059 assert!(!services.capabilities().exec);
1060 assert!(services.command_runner().is_none());
1061 }
1062
1063 // --- helpers for fs_ext / read_for_edit / write_for_edit coverage ---
1064 //

Callers

nothing calls this directly

Calls 2

buildMethod · 0.45
capabilitiesMethod · 0.45

Tested by

no test coverage detected