Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-workhorse
Commits
27900114
Commit
27900114
authored
Dec 18, 2015
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move errorpage tests into their package
parent
244e1b98
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
47 additions
and
39 deletions
+47
-39
Makefile
Makefile
+1
-0
authorization_test.go
authorization_test.go
+2
-1
deploy_page_test.go
deploy_page_test.go
+3
-2
development_test.go
development_test.go
+2
-1
handlers_test.go
handlers_test.go
+4
-3
internal/errorpage/error_pages.go
internal/errorpage/error_pages.go
+1
-1
internal/errorpage/error_pages_test.go
internal/errorpage/error_pages_test.go
+8
-8
internal/helper/test.go
internal/helper/test.go
+4
-4
proxy_test.go
proxy_test.go
+9
-8
servefile_test.go
servefile_test.go
+9
-8
uploads_test.go
uploads_test.go
+4
-3
No files found.
Makefile
View file @
27900114
...
@@ -10,6 +10,7 @@ install: gitlab-workhorse
...
@@ -10,6 +10,7 @@ install: gitlab-workhorse
.PHONY
:
test
.PHONY
:
test
test
:
test/data/group/test.git clean-workhorse gitlab-workhorse
test
:
test/data/group/test.git clean-workhorse gitlab-workhorse
go
fmt
|
awk
'{ print "Please run go fmt"; exit 1 }'
go
fmt
|
awk
'{ print "Please run go fmt"; exit 1 }'
go
test
./internal/...
go
test
go
test
coverage
:
test/data/group/test.git
coverage
:
test/data/group/test.git
...
...
authorization_test.go
View file @
27900114
...
@@ -2,6 +2,7 @@ package main
...
@@ -2,6 +2,7 @@ package main
import
(
import
(
"./internal/api"
"./internal/api"
"./internal/helper"
"fmt"
"fmt"
"net/http"
"net/http"
"net/http/httptest"
"net/http/httptest"
...
@@ -28,7 +29,7 @@ func runPreAuthorizeHandler(t *testing.T, suffix string, url *regexp.Regexp, api
...
@@ -28,7 +29,7 @@ func runPreAuthorizeHandler(t *testing.T, suffix string, url *regexp.Regexp, api
response
:=
httptest
.
NewRecorder
()
response
:=
httptest
.
NewRecorder
()
api
.
PreAuthorizeHandler
(
okHandler
,
suffix
)(
response
,
httpRequest
)
api
.
PreAuthorizeHandler
(
okHandler
,
suffix
)(
response
,
httpRequest
)
a
ssertResponseCode
(
t
,
response
,
expectedCode
)
helper
.
A
ssertResponseCode
(
t
,
response
,
expectedCode
)
return
response
return
response
}
}
...
...
deploy_page_test.go
View file @
27900114
package
main
package
main
import
(
import
(
"./internal/helper"
"io/ioutil"
"io/ioutil"
"net/http"
"net/http"
"net/http/httptest"
"net/http/httptest"
...
@@ -48,6 +49,6 @@ func TestIfDeployPageExist(t *testing.T) {
...
@@ -48,6 +49,6 @@ func TestIfDeployPageExist(t *testing.T) {
}
}
w
.
Flush
()
w
.
Flush
()
a
ssertResponseCode
(
t
,
w
,
200
)
helper
.
A
ssertResponseCode
(
t
,
w
,
200
)
a
ssertResponseBody
(
t
,
w
,
deployPage
)
helper
.
A
ssertResponseBody
(
t
,
w
,
deployPage
)
}
}
development_test.go
View file @
27900114
package
main
package
main
import
(
import
(
"./internal/helper"
"net/http"
"net/http"
"net/http/httptest"
"net/http/httptest"
"testing"
"testing"
...
@@ -34,5 +35,5 @@ func TestDevelopmentModeDisabled(t *testing.T) {
...
@@ -34,5 +35,5 @@ func TestDevelopmentModeDisabled(t *testing.T) {
if
executed
{
if
executed
{
t
.
Error
(
"The handler should not get executed"
)
t
.
Error
(
"The handler should not get executed"
)
}
}
a
ssertResponseCode
(
t
,
w
,
404
)
helper
.
A
ssertResponseCode
(
t
,
w
,
404
)
}
}
handlers_test.go
View file @
27900114
package
main
package
main
import
(
import
(
"./internal/helper"
"bytes"
"bytes"
"compress/gzip"
"compress/gzip"
"fmt"
"fmt"
...
@@ -36,7 +37,7 @@ func TestGzipEncoding(t *testing.T) {
...
@@ -36,7 +37,7 @@ func TestGzipEncoding(t *testing.T) {
}
}
})(
resp
,
req
)
})(
resp
,
req
)
a
ssertResponseCode
(
t
,
resp
,
200
)
helper
.
A
ssertResponseCode
(
t
,
resp
,
200
)
}
}
func
TestNoEncoding
(
t
*
testing
.
T
)
{
func
TestNoEncoding
(
t
*
testing
.
T
)
{
...
@@ -60,7 +61,7 @@ func TestNoEncoding(t *testing.T) {
...
@@ -60,7 +61,7 @@ func TestNoEncoding(t *testing.T) {
}
}
})(
resp
,
req
)
})(
resp
,
req
)
a
ssertResponseCode
(
t
,
resp
,
200
)
helper
.
A
ssertResponseCode
(
t
,
resp
,
200
)
}
}
func
TestInvalidEncoding
(
t
*
testing
.
T
)
{
func
TestInvalidEncoding
(
t
*
testing
.
T
)
{
...
@@ -76,5 +77,5 @@ func TestInvalidEncoding(t *testing.T) {
...
@@ -76,5 +77,5 @@ func TestInvalidEncoding(t *testing.T) {
t
.
Fatal
(
"it shouldn't be executed"
)
t
.
Fatal
(
"it shouldn't be executed"
)
})(
resp
,
req
)
})(
resp
,
req
)
a
ssertResponseCode
(
t
,
resp
,
500
)
helper
.
A
ssertResponseCode
(
t
,
resp
,
500
)
}
}
internal/errorpage/error_pages.go
View file @
27900114
package
errorpage
package
errorpage
import
(
import
(
"../helper"
"../helper"
"fmt"
"fmt"
"io/ioutil"
"io/ioutil"
"log"
"log"
...
...
error_pages_test.go
→
internal/errorpage/
error_pages_test.go
View file @
27900114
package
main
package
errorpage
import
(
import
(
".
/internal/errorpage
"
".
./helper
"
"fmt"
"fmt"
"io/ioutil"
"io/ioutil"
"net/http"
"net/http"
...
@@ -26,11 +26,11 @@ func TestIfErrorPageIsPresented(t *testing.T) {
...
@@ -26,11 +26,11 @@ func TestIfErrorPageIsPresented(t *testing.T) {
w
.
WriteHeader
(
404
)
w
.
WriteHeader
(
404
)
fmt
.
Fprint
(
w
,
"Not Found"
)
fmt
.
Fprint
(
w
,
"Not Found"
)
})
})
errorpage
.
Inject
(
dir
,
h
)(
w
,
nil
)
Inject
(
dir
,
h
)(
w
,
nil
)
w
.
Flush
()
w
.
Flush
()
a
ssertResponseCode
(
t
,
w
,
404
)
helper
.
A
ssertResponseCode
(
t
,
w
,
404
)
a
ssertResponseBody
(
t
,
w
,
errorPage
)
helper
.
A
ssertResponseBody
(
t
,
w
,
errorPage
)
}
}
func
TestIfErrorPassedIfNoErrorPageIsFound
(
t
*
testing
.
T
)
{
func
TestIfErrorPassedIfNoErrorPageIsFound
(
t
*
testing
.
T
)
{
...
@@ -46,9 +46,9 @@ func TestIfErrorPassedIfNoErrorPageIsFound(t *testing.T) {
...
@@ -46,9 +46,9 @@ func TestIfErrorPassedIfNoErrorPageIsFound(t *testing.T) {
w
.
WriteHeader
(
404
)
w
.
WriteHeader
(
404
)
fmt
.
Fprint
(
w
,
errorResponse
)
fmt
.
Fprint
(
w
,
errorResponse
)
})
})
errorpage
.
Inject
(
dir
,
h
)(
w
,
nil
)
Inject
(
dir
,
h
)(
w
,
nil
)
w
.
Flush
()
w
.
Flush
()
a
ssertResponseCode
(
t
,
w
,
404
)
helper
.
A
ssertResponseCode
(
t
,
w
,
404
)
a
ssertResponseBody
(
t
,
w
,
errorResponse
)
helper
.
A
ssertResponseBody
(
t
,
w
,
errorResponse
)
}
}
helpers_
test.go
→
internal/helper/
test.go
View file @
27900114
package
main
package
helper
import
(
import
(
"net/http/httptest"
"net/http/httptest"
"testing"
"testing"
)
)
func
a
ssertResponseCode
(
t
*
testing
.
T
,
response
*
httptest
.
ResponseRecorder
,
expectedCode
int
)
{
func
A
ssertResponseCode
(
t
*
testing
.
T
,
response
*
httptest
.
ResponseRecorder
,
expectedCode
int
)
{
if
response
.
Code
!=
expectedCode
{
if
response
.
Code
!=
expectedCode
{
t
.
Fatalf
(
"for HTTP request expected to get %d, got %d instead"
,
expectedCode
,
response
.
Code
)
t
.
Fatalf
(
"for HTTP request expected to get %d, got %d instead"
,
expectedCode
,
response
.
Code
)
}
}
}
}
func
a
ssertResponseBody
(
t
*
testing
.
T
,
response
*
httptest
.
ResponseRecorder
,
expectedBody
string
)
{
func
A
ssertResponseBody
(
t
*
testing
.
T
,
response
*
httptest
.
ResponseRecorder
,
expectedBody
string
)
{
if
response
.
Body
.
String
()
!=
expectedBody
{
if
response
.
Body
.
String
()
!=
expectedBody
{
t
.
Fatalf
(
"for HTTP request expected to receive %q, got %q instead as body"
,
expectedBody
,
response
.
Body
.
String
())
t
.
Fatalf
(
"for HTTP request expected to receive %q, got %q instead as body"
,
expectedBody
,
response
.
Body
.
String
())
}
}
}
}
func
a
ssertResponseHeader
(
t
*
testing
.
T
,
response
*
httptest
.
ResponseRecorder
,
header
string
,
expectedValue
string
)
{
func
A
ssertResponseHeader
(
t
*
testing
.
T
,
response
*
httptest
.
ResponseRecorder
,
header
string
,
expectedValue
string
)
{
if
response
.
Header
()
.
Get
(
header
)
!=
expectedValue
{
if
response
.
Header
()
.
Get
(
header
)
!=
expectedValue
{
t
.
Fatalf
(
"for HTTP request expected to receive the header %q with %q, got %q"
,
header
,
expectedValue
,
response
.
Header
()
.
Get
(
header
))
t
.
Fatalf
(
"for HTTP request expected to receive the header %q with %q, got %q"
,
header
,
expectedValue
,
response
.
Header
()
.
Get
(
header
))
}
}
...
...
proxy_test.go
View file @
27900114
package
main
package
main
import
(
import
(
"./internal/helper"
"./internal/proxy"
"./internal/proxy"
"bytes"
"bytes"
"fmt"
"fmt"
...
@@ -44,8 +45,8 @@ func TestProxyRequest(t *testing.T) {
...
@@ -44,8 +45,8 @@ func TestProxyRequest(t *testing.T) {
u
:=
newUpstream
(
ts
.
URL
,
""
)
u
:=
newUpstream
(
ts
.
URL
,
""
)
w
:=
httptest
.
NewRecorder
()
w
:=
httptest
.
NewRecorder
()
u
.
Proxy
.
ServeHTTP
(
w
,
httpRequest
)
u
.
Proxy
.
ServeHTTP
(
w
,
httpRequest
)
a
ssertResponseCode
(
t
,
w
,
202
)
helper
.
A
ssertResponseCode
(
t
,
w
,
202
)
a
ssertResponseBody
(
t
,
w
,
"RESPONSE"
)
helper
.
A
ssertResponseBody
(
t
,
w
,
"RESPONSE"
)
if
w
.
Header
()
.
Get
(
"Custom-Response-Header"
)
!=
"test"
{
if
w
.
Header
()
.
Get
(
"Custom-Response-Header"
)
!=
"test"
{
t
.
Fatal
(
"Expected custom response header"
)
t
.
Fatal
(
"Expected custom response header"
)
...
@@ -62,8 +63,8 @@ func TestProxyError(t *testing.T) {
...
@@ -62,8 +63,8 @@ func TestProxyError(t *testing.T) {
u
:=
newUpstream
(
"http://localhost:655575/"
,
""
)
u
:=
newUpstream
(
"http://localhost:655575/"
,
""
)
w
:=
httptest
.
NewRecorder
()
w
:=
httptest
.
NewRecorder
()
u
.
Proxy
.
ServeHTTP
(
w
,
httpRequest
)
u
.
Proxy
.
ServeHTTP
(
w
,
httpRequest
)
a
ssertResponseCode
(
t
,
w
,
502
)
helper
.
A
ssertResponseCode
(
t
,
w
,
502
)
a
ssertResponseBody
(
t
,
w
,
"dial tcp: invalid port 655575"
)
helper
.
A
ssertResponseBody
(
t
,
w
,
"dial tcp: invalid port 655575"
)
}
}
func
TestProxyReadTimeout
(
t
*
testing
.
T
)
{
func
TestProxyReadTimeout
(
t
*
testing
.
T
)
{
...
@@ -97,8 +98,8 @@ func TestProxyReadTimeout(t *testing.T) {
...
@@ -97,8 +98,8 @@ func TestProxyReadTimeout(t *testing.T) {
w
:=
httptest
.
NewRecorder
()
w
:=
httptest
.
NewRecorder
()
u
.
Proxy
.
ServeHTTP
(
w
,
httpRequest
)
u
.
Proxy
.
ServeHTTP
(
w
,
httpRequest
)
a
ssertResponseCode
(
t
,
w
,
502
)
helper
.
A
ssertResponseCode
(
t
,
w
,
502
)
a
ssertResponseBody
(
t
,
w
,
"net/http: timeout awaiting response headers"
)
helper
.
A
ssertResponseBody
(
t
,
w
,
"net/http: timeout awaiting response headers"
)
}
}
func
TestProxyHandlerTimeout
(
t
*
testing
.
T
)
{
func
TestProxyHandlerTimeout
(
t
*
testing
.
T
)
{
...
@@ -117,6 +118,6 @@ func TestProxyHandlerTimeout(t *testing.T) {
...
@@ -117,6 +118,6 @@ func TestProxyHandlerTimeout(t *testing.T) {
w
:=
httptest
.
NewRecorder
()
w
:=
httptest
.
NewRecorder
()
u
.
Proxy
.
ServeHTTP
(
w
,
httpRequest
)
u
.
Proxy
.
ServeHTTP
(
w
,
httpRequest
)
a
ssertResponseCode
(
t
,
w
,
503
)
helper
.
A
ssertResponseCode
(
t
,
w
,
503
)
a
ssertResponseBody
(
t
,
w
,
"Request took too long"
)
helper
.
A
ssertResponseBody
(
t
,
w
,
"Request took too long"
)
}
}
servefile_test.go
View file @
27900114
package
main
package
main
import
(
import
(
"./internal/helper"
"bytes"
"bytes"
"compress/gzip"
"compress/gzip"
"io/ioutil"
"io/ioutil"
...
@@ -19,7 +20,7 @@ func TestServingNonExistingFile(t *testing.T) {
...
@@ -19,7 +20,7 @@ func TestServingNonExistingFile(t *testing.T) {
w
:=
httptest
.
NewRecorder
()
w
:=
httptest
.
NewRecorder
()
dummyUpstream
.
handleServeFile
(
&
dir
,
CacheDisabled
,
nil
)(
w
,
httpRequest
)
dummyUpstream
.
handleServeFile
(
&
dir
,
CacheDisabled
,
nil
)(
w
,
httpRequest
)
a
ssertResponseCode
(
t
,
w
,
404
)
helper
.
A
ssertResponseCode
(
t
,
w
,
404
)
}
}
func
TestServingDirectory
(
t
*
testing
.
T
)
{
func
TestServingDirectory
(
t
*
testing
.
T
)
{
...
@@ -32,7 +33,7 @@ func TestServingDirectory(t *testing.T) {
...
@@ -32,7 +33,7 @@ func TestServingDirectory(t *testing.T) {
httpRequest
,
_
:=
http
.
NewRequest
(
"GET"
,
"/file"
,
nil
)
httpRequest
,
_
:=
http
.
NewRequest
(
"GET"
,
"/file"
,
nil
)
w
:=
httptest
.
NewRecorder
()
w
:=
httptest
.
NewRecorder
()
dummyUpstream
.
handleServeFile
(
&
dir
,
CacheDisabled
,
nil
)(
w
,
httpRequest
)
dummyUpstream
.
handleServeFile
(
&
dir
,
CacheDisabled
,
nil
)(
w
,
httpRequest
)
a
ssertResponseCode
(
t
,
w
,
404
)
helper
.
A
ssertResponseCode
(
t
,
w
,
404
)
}
}
func
TestServingMalformedUri
(
t
*
testing
.
T
)
{
func
TestServingMalformedUri
(
t
*
testing
.
T
)
{
...
@@ -41,7 +42,7 @@ func TestServingMalformedUri(t *testing.T) {
...
@@ -41,7 +42,7 @@ func TestServingMalformedUri(t *testing.T) {
w
:=
httptest
.
NewRecorder
()
w
:=
httptest
.
NewRecorder
()
dummyUpstream
.
handleServeFile
(
&
dir
,
CacheDisabled
,
nil
)(
w
,
httpRequest
)
dummyUpstream
.
handleServeFile
(
&
dir
,
CacheDisabled
,
nil
)(
w
,
httpRequest
)
a
ssertResponseCode
(
t
,
w
,
404
)
helper
.
A
ssertResponseCode
(
t
,
w
,
404
)
}
}
func
TestExecutingHandlerWhenNoFileFound
(
t
*
testing
.
T
)
{
func
TestExecutingHandlerWhenNoFileFound
(
t
*
testing
.
T
)
{
...
@@ -71,7 +72,7 @@ func TestServingTheActualFile(t *testing.T) {
...
@@ -71,7 +72,7 @@ func TestServingTheActualFile(t *testing.T) {
w
:=
httptest
.
NewRecorder
()
w
:=
httptest
.
NewRecorder
()
dummyUpstream
.
handleServeFile
(
&
dir
,
CacheDisabled
,
nil
)(
w
,
httpRequest
)
dummyUpstream
.
handleServeFile
(
&
dir
,
CacheDisabled
,
nil
)(
w
,
httpRequest
)
a
ssertResponseCode
(
t
,
w
,
200
)
helper
.
A
ssertResponseCode
(
t
,
w
,
200
)
if
w
.
Body
.
String
()
!=
fileContent
{
if
w
.
Body
.
String
()
!=
fileContent
{
t
.
Error
(
"We should serve the file: "
,
w
.
Body
.
String
())
t
.
Error
(
"We should serve the file: "
,
w
.
Body
.
String
())
}
}
...
@@ -102,15 +103,15 @@ func testServingThePregzippedFile(t *testing.T, enableGzip bool) {
...
@@ -102,15 +103,15 @@ func testServingThePregzippedFile(t *testing.T, enableGzip bool) {
w
:=
httptest
.
NewRecorder
()
w
:=
httptest
.
NewRecorder
()
dummyUpstream
.
handleServeFile
(
&
dir
,
CacheDisabled
,
nil
)(
w
,
httpRequest
)
dummyUpstream
.
handleServeFile
(
&
dir
,
CacheDisabled
,
nil
)(
w
,
httpRequest
)
a
ssertResponseCode
(
t
,
w
,
200
)
helper
.
A
ssertResponseCode
(
t
,
w
,
200
)
if
enableGzip
{
if
enableGzip
{
a
ssertResponseHeader
(
t
,
w
,
"Content-Encoding"
,
"gzip"
)
helper
.
A
ssertResponseHeader
(
t
,
w
,
"Content-Encoding"
,
"gzip"
)
if
bytes
.
Compare
(
w
.
Body
.
Bytes
(),
fileGzipContent
.
Bytes
())
!=
0
{
if
bytes
.
Compare
(
w
.
Body
.
Bytes
(),
fileGzipContent
.
Bytes
())
!=
0
{
t
.
Error
(
"We should serve the pregzipped file"
)
t
.
Error
(
"We should serve the pregzipped file"
)
}
}
}
else
{
}
else
{
a
ssertResponseCode
(
t
,
w
,
200
)
helper
.
A
ssertResponseCode
(
t
,
w
,
200
)
a
ssertResponseHeader
(
t
,
w
,
"Content-Encoding"
,
""
)
helper
.
A
ssertResponseHeader
(
t
,
w
,
"Content-Encoding"
,
""
)
if
w
.
Body
.
String
()
!=
fileContent
{
if
w
.
Body
.
String
()
!=
fileContent
{
t
.
Error
(
"We should serve the file: "
,
w
.
Body
.
String
())
t
.
Error
(
"We should serve the file: "
,
w
.
Body
.
String
())
}
}
...
...
uploads_test.go
View file @
27900114
package
main
package
main
import
(
import
(
"./internal/helper"
"bytes"
"bytes"
"fmt"
"fmt"
"io"
"io"
...
@@ -18,7 +19,7 @@ func TestUploadTempPathRequirement(t *testing.T) {
...
@@ -18,7 +19,7 @@ func TestUploadTempPathRequirement(t *testing.T) {
response
:=
httptest
.
NewRecorder
()
response
:=
httptest
.
NewRecorder
()
request
:=
&
http
.
Request
{}
request
:=
&
http
.
Request
{}
handleFileUploads
(
dummyUpstream
.
Proxy
)
.
ServeHTTP
(
response
,
request
)
handleFileUploads
(
dummyUpstream
.
Proxy
)
.
ServeHTTP
(
response
,
request
)
a
ssertResponseCode
(
t
,
response
,
500
)
helper
.
A
ssertResponseCode
(
t
,
response
,
500
)
}
}
func
TestUploadHandlerForwardingRawData
(
t
*
testing
.
T
)
{
func
TestUploadHandlerForwardingRawData
(
t
*
testing
.
T
)
{
...
@@ -54,7 +55,7 @@ func TestUploadHandlerForwardingRawData(t *testing.T) {
...
@@ -54,7 +55,7 @@ func TestUploadHandlerForwardingRawData(t *testing.T) {
u
:=
newUpstream
(
ts
.
URL
,
""
)
u
:=
newUpstream
(
ts
.
URL
,
""
)
handleFileUploads
(
u
.
Proxy
)
.
ServeHTTP
(
response
,
httpRequest
)
handleFileUploads
(
u
.
Proxy
)
.
ServeHTTP
(
response
,
httpRequest
)
a
ssertResponseCode
(
t
,
response
,
202
)
helper
.
A
ssertResponseCode
(
t
,
response
,
202
)
if
response
.
Body
.
String
()
!=
"RESPONSE"
{
if
response
.
Body
.
String
()
!=
"RESPONSE"
{
t
.
Fatal
(
"Expected RESPONSE in response body"
)
t
.
Fatal
(
"Expected RESPONSE in response body"
)
}
}
...
@@ -129,7 +130,7 @@ func TestUploadHandlerRewritingMultiPartData(t *testing.T) {
...
@@ -129,7 +130,7 @@ func TestUploadHandlerRewritingMultiPartData(t *testing.T) {
u
:=
newUpstream
(
ts
.
URL
,
""
)
u
:=
newUpstream
(
ts
.
URL
,
""
)
handleFileUploads
(
u
.
Proxy
)
.
ServeHTTP
(
response
,
httpRequest
)
handleFileUploads
(
u
.
Proxy
)
.
ServeHTTP
(
response
,
httpRequest
)
a
ssertResponseCode
(
t
,
response
,
202
)
helper
.
A
ssertResponseCode
(
t
,
response
,
202
)
if
_
,
err
:=
os
.
Stat
(
filePath
);
!
os
.
IsNotExist
(
err
)
{
if
_
,
err
:=
os
.
Stat
(
filePath
);
!
os
.
IsNotExist
(
err
)
{
t
.
Fatal
(
"expected the file to be deleted"
)
t
.
Fatal
(
"expected the file to be deleted"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment