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

Function create_branch_succeeds_on_201

core/src/workspace/remote_git.rs:1029–1047  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1027
1028 #[tokio::test]
1029 async fn create_branch_succeeds_on_201() {
1030 let (server, backend) = server_and_backend().await;
1031 Mock::given(method("POST"))
1032 .and(path("/v1/repos/test/git/branches/create"))
1033 .and(wiremock::matchers::body_json(json!({
1034 "name":"feat/x","base":"main"
1035 })))
1036 .respond_with(ResponseTemplate::new(201).set_body_json(json!({})))
1037 .mount(&server)
1038 .await;
1039
1040 backend
1041 .create_branch(WorkspaceGitCreateBranchRequest {
1042 name: "feat/x".into(),
1043 base: "main".into(),
1044 })
1045 .await
1046 .unwrap();
1047 }
1048
1049 #[tokio::test]
1050 async fn create_branch_409_yields_remote_git_conflict() {

Callers

nothing calls this directly

Calls 2

server_and_backendFunction · 0.85
create_branchMethod · 0.45

Tested by

no test coverage detected