Simple blogging system written in Go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
619 B

package main
import (
func Test_localMediaStorage(t *testing.T) {
testDir := t.TempDir()
l := &localMediaStorage{
mediaURL: "",
path: testDir,
testFileContent := "This is a test"
loc, err :="test.txt", strings.NewReader(testFileContent))
require.Nil(t, err)
assert.Equal(t, "", loc)
file, err := os.ReadFile(filepath.Join(testDir, "test.txt"))
require.Nil(t, err)
assert.Equal(t, testFileContent, string(file))