fix syntax_error in fake workspace

This commit is contained in:
Denis Bilenko 2025-02-12 11:37:44 +01:00
parent 27cb55e46f
commit adee4c9998
1 changed files with 5 additions and 7 deletions

View File

@ -4,7 +4,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"path"
"sort"
"strconv"
"strings"
@ -77,11 +77,11 @@ func (s *FakeWorkspace) WorkspaceDelete(path string, recursive bool) {
}
}
func (s *FakeWorkspace) WorkspaceFilesImportFile(path string, body []byte) {
if !strings.HasPrefix(path, "/") {
path = "/" + path
func (s *FakeWorkspace) WorkspaceFilesImportFile(p string, body []byte) {
if !strings.HasPrefix(p, "/") {
p = "/" + p
}
s.files[path] = body
s.files[p] = body
for {
p = path.Dir(p)
@ -91,8 +91,6 @@ func (s *FakeWorkspace) WorkspaceFilesImportFile(path string, body []byte) {
s.directories[p] = true
}
return "{}", http.StatusOK
}
func (s *FakeWorkspace) JobsCreate(request jobs.CreateJob) Response {