add stop server to API 4 tests (#6638)

Этот коммит содержится в:
Saturnino Abril
2017-06-15 05:29:05 +08:00
коммит произвёл Corey Hulen
родитель 1138dd6770
Коммит 5b017171cd
2 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@@ -105,6 +105,12 @@ func Setup() *TestHelper {
return th
}
func StopServer() {
if app.Srv != nil {
app.StopServer()
}
}
func TearDown() {
utils.DisableDebugLogForTest()

Просмотреть файл

@@ -71,3 +71,12 @@ func TestWebSocket(t *testing.T) {
}
}
}
func TestZZWebSocketTearDown(t *testing.T) {
// *IMPORTANT* - Kind of hacky
// This should be the last function in any test file
// that calls Setup()
// Should be in the last file too sorted by name
time.Sleep(2 * time.Second)
StopServer()
}