mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-06-08 08:52:27 +02:00
Switch to "T.TempDir()" to avoid manual cleanup.
This commit is contained in:
parent
b98a00ec10
commit
9c2df744c1
|
@ -27,7 +27,6 @@ import (
|
||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
"encoding/pem"
|
"encoding/pem"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -43,16 +42,12 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
func newProxyServerForTest(t *testing.T) (*ProxyServer, *rsa.PrivateKey, func()) {
|
func newProxyServerForTest(t *testing.T) (*ProxyServer, *rsa.PrivateKey, func()) {
|
||||||
tempdir, err := ioutil.TempDir("", "test")
|
tempdir := t.TempDir()
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("could not create temporary folder: %s", err)
|
|
||||||
}
|
|
||||||
var server *ProxyServer
|
var server *ProxyServer
|
||||||
shutdown := func() {
|
shutdown := func() {
|
||||||
if server != nil {
|
if server != nil {
|
||||||
server.Stop()
|
server.Stop()
|
||||||
}
|
}
|
||||||
os.RemoveAll(tempdir)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
|
|
Loading…
Reference in a new issue