fix tls testing.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-04-04 23:49:52 +08:00
parent 5a6236ecfe
commit 5055ca693d
1 changed files with 14 additions and 16 deletions

View File

@ -39,25 +39,23 @@ func TestRunNormalServer(t *testing.T) {
gofight.TestRequest(t, "http://localhost:8088/api/status") gofight.TestRequest(t, "http://localhost:8088/api/status")
} }
// func TestRunTLSServer(t *testing.T) { func TestRunTLSServer(t *testing.T) {
// initTest() initTest()
// PushConf.Core.SSL = true PushConf.Core.SSL = true
// PushConf.Core.Port = "8087" PushConf.Core.Port = "8087"
// PushConf.Core.CertPath = "../certificate/localhost.cert" PushConf.Core.CertPath = "../certificate/localhost.cert"
// PushConf.Core.KeyPath = "../certificate/localhost.key" PushConf.Core.KeyPath = "../certificate/localhost.key"
// router := gin.New()
// go func() { go func() {
// assert.NoError(t, RunHTTPServer()) assert.NoError(t, RunHTTPServer())
// }() }()
// // have to wait for the goroutine to start and run the server // have to wait for the goroutine to start and run the server
// // otherwise the main thread will complete // otherwise the main thread will complete
// time.Sleep(5 * time.Millisecond) time.Sleep(5 * time.Millisecond)
// assert.Error(t, router.Run(":8087")) assert.Error(t, RunHTTPServer())
// testRequest(t, "https://localhost:8087/api/status") }
// }
func TestRootHandler(t *testing.T) { func TestRootHandler(t *testing.T) {
initTest() initTest()