Minor stuff: debug logs, unit test update
This commit is contained in:
@@ -18,9 +18,10 @@ package controller
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
)
|
||||
|
||||
type requestType int
|
||||
@@ -64,6 +65,7 @@ func (fs *fileStore) fileStoreService() {
|
||||
req := <-fs.requestChannel
|
||||
response := &fileStoreResponse{}
|
||||
|
||||
log.WithFields(log.Fields{"file": req.fileName, "type": req.requestType}).Debug("fileStore request")
|
||||
switch req.requestType {
|
||||
case READ:
|
||||
response.fileContents, response.error = ioutil.ReadFile(path.Join(fs.root, req.fileName))
|
||||
|
||||
@@ -40,7 +40,7 @@ func TestFileStore(t *testing.T) {
|
||||
t.Fatalf("expected an error")
|
||||
}
|
||||
|
||||
path := "foo"
|
||||
path := "fileStoreTest"
|
||||
contents := []byte("bar")
|
||||
err = fs.write(path, contents)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user