test get media

master
Bel LaPointe 2022-02-08 10:56:30 -07:00
parent 7223cb6af9
commit fd74e730ec
1 changed files with 6 additions and 0 deletions

View File

@ -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