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