cleanup test local-url

This commit is contained in:
2022-12-14 17:02:18 +01:00
parent 203360e8b5
commit 0750bf1d8a
6 changed files with 42 additions and 118 deletions

View File

@@ -7,18 +7,16 @@ import (
)
func TestWebserver(t *testing.T) {
ws, stop := tt.StartSimpleWebserver(t)
_, baseUrl, stop := tt.StartSimpleWebserver(t)
defer stop()
fmt.Printf("Port := %s\n", ws.Port)
fmt.Printf("URL := %s\n", baseUrl)
}
func TestPing(t *testing.T) {
ws, stop := tt.StartSimpleWebserver(t)
_, baseUrl, stop := tt.StartSimpleWebserver(t)
defer stop()
baseUrl := "http://127.0.0.1:" + ws.Port
_ = tt.RequestGet[tt.Void](t, baseUrl, "/api/ping")
_ = tt.RequestPut[tt.Void](t, baseUrl, "/api/ping", nil)
_ = tt.RequestPost[tt.Void](t, baseUrl, "/api/ping", nil)
@@ -27,19 +25,15 @@ func TestPing(t *testing.T) {
}
func TestMongo(t *testing.T) {
ws, stop := tt.StartSimpleWebserver(t)
_, baseUrl, stop := tt.StartSimpleWebserver(t)
defer stop()
baseUrl := "http://127.0.0.1:" + ws.Port
_ = tt.RequestPost[tt.Void](t, baseUrl, "/api/db-test", nil)
}
func TestHealth(t *testing.T) {
ws, stop := tt.StartSimpleWebserver(t)
_, baseUrl, stop := tt.StartSimpleWebserver(t)
defer stop()
baseUrl := "http://127.0.0.1:" + ws.Port
_ = tt.RequestGet[tt.Void](t, baseUrl, "/api/health")
}