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

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-12-05 19:05:14 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-12-05 19:05:14 +0300
commit07ac526ac57e71b6cfd6b810709b1255b65dd113 (patch)
tree14ea757bb01bc330d6609a0837e9fccfce8ab9cb /helpers_test.go
parentaf3eeb3bf82c49bfe3b0371b5fb8aaf1ad9ff1b2 (diff)
Improve tests for gitlab source cache
Diffstat (limited to 'helpers_test.go')
-rw-r--r--helpers_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/helpers_test.go b/helpers_test.go
index fc903404..26f432c6 100644
--- a/helpers_test.go
+++ b/helpers_test.go
@@ -387,14 +387,14 @@ func NewGitlabDomainsSourceStub(t *testing.T) *httptest.Server {
domain := r.URL.Query().Get("host")
path := "shared/lookups/" + domain + ".json"
- if _, err := os.Stat(path); os.IsNotExist(err) {
+ fixture, err := os.Open(path)
+ if os.IsNotExist(err) {
w.WriteHeader(http.StatusNoContent)
t.Logf("GitLab domain %s source stub served 204", domain)
return
}
- fixture, err := os.Open(path)
defer fixture.Close()
require.NoError(t, err)