test get media
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user