test get media
parent
7223cb6af9
commit
fd74e730ec
|
|
@ -2,8 +2,11 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
|
"os"
|
||||||
|
"path"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -13,6 +16,9 @@ func TestServerRoutes(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
os.MkdirAll(path.Join(server.root, "media"), os.ModePerm)
|
||||||
|
ioutil.WriteFile(path.Join(server.root, "media", "id"), []byte("hi"), os.ModePerm)
|
||||||
|
|
||||||
cases := map[string]struct {
|
cases := map[string]struct {
|
||||||
path string
|
path string
|
||||||
method string
|
method string
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue