Update gin_integration_test.go

test
This commit is contained in:
迷茫少年 2021-08-17 14:42:20 +08:00 committed by GitHub
parent a1f4f8406c
commit 1062d79a37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,21 +70,6 @@ func TestRunServer(t *testing.T) {
testRequest(t, "http://localhost:8090/example")
}
func TestRunTLS(t *testing.T) {
router := New()
go func() {
router.GET("/example", func(c *Context) { c.String(http.StatusOK, "it worked") })
assert.NoError(t, router.RunTLS(":8443", "./testdata/certificate/cert.pem", "./testdata/certificate/key.pem"))
}()
// have to wait for the goroutine to start and run the server
// otherwise the main thread will complete
time.Sleep(5 * time.Millisecond)
assert.Error(t, router.RunTLS(":8443", "./testdata/certificate/cert.pem", "./testdata/certificate/key.pem"))
testRequest(t, "https://localhost:8443/example")
}
func TestPusher(t *testing.T) {
var html = template.Must(template.New("https").Parse(`