Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'workhorse/internal/staticpages/deploy_page_test.go')
-rw-r--r--workhorse/internal/staticpages/deploy_page_test.go15
1 files changed, 3 insertions, 12 deletions
diff --git a/workhorse/internal/staticpages/deploy_page_test.go b/workhorse/internal/staticpages/deploy_page_test.go
index bc413880184..52ac69da23c 100644
--- a/workhorse/internal/staticpages/deploy_page_test.go
+++ b/workhorse/internal/staticpages/deploy_page_test.go
@@ -1,7 +1,6 @@
package staticpages
import (
- "io/ioutil"
"net/http"
"net/http/httptest"
"os"
@@ -14,11 +13,7 @@ import (
)
func TestIfNoDeployPageExist(t *testing.T) {
- dir, err := ioutil.TempDir("", "deploy")
- if err != nil {
- t.Fatal(err)
- }
- defer os.RemoveAll(dir)
+ dir := t.TempDir()
w := httptest.NewRecorder()
@@ -33,14 +28,10 @@ func TestIfNoDeployPageExist(t *testing.T) {
}
func TestIfDeployPageExist(t *testing.T) {
- dir, err := ioutil.TempDir("", "deploy")
- if err != nil {
- t.Fatal(err)
- }
- defer os.RemoveAll(dir)
+ dir := t.TempDir()
deployPage := "DEPLOY"
- ioutil.WriteFile(filepath.Join(dir, "index.html"), []byte(deployPage), 0600)
+ os.WriteFile(filepath.Join(dir, "index.html"), []byte(deployPage), 0600)
w := httptest.NewRecorder()