diff options
Diffstat (limited to 'tests/integration/ssh_key_test.go')
-rw-r--r-- | tests/integration/ssh_key_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/integration/ssh_key_test.go b/tests/integration/ssh_key_test.go index eb3a3e926a..b34a986be3 100644 --- a/tests/integration/ssh_key_test.go +++ b/tests/integration/ssh_key_test.go @@ -27,7 +27,7 @@ func doCheckRepositoryEmptyStatus(ctx APITestContext, isEmpty bool) func(*testin func doAddChangesToCheckout(dstPath, filename string) func(*testing.T) { return func(t *testing.T) { - assert.NoError(t, os.WriteFile(filepath.Join(dstPath, filename), []byte(fmt.Sprintf("# Testing Repository\n\nOriginally created in: %s at time: %v", dstPath, time.Now())), 0o644)) + assert.NoError(t, os.WriteFile(filepath.Join(dstPath, filename), fmt.Appendf(nil, "# Testing Repository\n\nOriginally created in: %s at time: %v", dstPath, time.Now()), 0o644)) assert.NoError(t, git.AddChanges(dstPath, true)) signature := git.Signature{ Email: "test@example.com", @@ -51,7 +51,7 @@ func testPushDeployKeyOnEmptyRepo(t *testing.T, u *url.URL) { ctx := NewAPITestContext(t, "user2", "deploy-key-empty-repo-1", auth_model.AccessTokenScopeWriteRepository, auth_model.AccessTokenScopeWriteUser) ctxWithDeleteRepo := NewAPITestContext(t, "user2", "deploy-key-empty-repo-1", auth_model.AccessTokenScopeWriteRepository, auth_model.AccessTokenScopeWriteUser) - keyname := fmt.Sprintf("%s-push", ctx.Reponame) + keyname := ctx.Reponame + "-push" u.Path = ctx.GitPath() t.Run("CreateEmptyRepository", doAPICreateRepository(ctx, true)) @@ -89,7 +89,7 @@ func testKeyOnlyOneType(t *testing.T, u *url.URL) { reponame := "ssh-key-test-repo" username := "user2" u.Path = fmt.Sprintf("%s/%s.git", username, reponame) - keyname := fmt.Sprintf("%s-push", reponame) + keyname := reponame + "-push" // OK login ctx := NewAPITestContext(t, username, reponame, auth_model.AccessTokenScopeWriteRepository, auth_model.AccessTokenScopeWriteUser) |