added some tests for the json storage.

This commit is contained in:
sm
2016-02-15 01:42:20 -08:00
parent 9e9bb74c4a
commit 456d502b72
4 changed files with 96 additions and 13 deletions
+8 -8
View File
@@ -11,7 +11,7 @@ import (
)
func TestAdd(t *testing.T) {
ms := NewMemStore("")
ms := NewSimpleStore("")
s := &Server{
storage: ms,
}
@@ -78,7 +78,7 @@ func TestAdd(t *testing.T) {
}
func TestInvalidPath(t *testing.T) {
ms := NewMemStore("")
ms := NewSimpleStore("")
s := &Server{
storage: ms,
}
@@ -98,7 +98,7 @@ func TestInvalidPath(t *testing.T) {
}
func TestCannotDuplicateExistingPath(t *testing.T) {
ms := NewMemStore("")
ms := NewSimpleStore("")
s := &Server{
storage: ms,
}
@@ -123,7 +123,7 @@ func TestCannotDuplicateExistingPath(t *testing.T) {
}
func TestCannotAddExistingSubPath(t *testing.T) {
ms := NewMemStore("")
ms := NewSimpleStore("")
s := &Server{
storage: ms,
}
@@ -151,7 +151,7 @@ func TestCannotAddExistingSubPath(t *testing.T) {
}
func TestMissingRepo(t *testing.T) {
ms := NewMemStore("")
ms := NewSimpleStore("")
s := &Server{
storage: ms,
}
@@ -171,7 +171,7 @@ func TestMissingRepo(t *testing.T) {
}
func TestBadJson(t *testing.T) {
ms := NewMemStore("")
ms := NewSimpleStore("")
s := &Server{
storage: ms,
}
@@ -191,7 +191,7 @@ func TestBadJson(t *testing.T) {
}
func TestUnsupportedMethod(t *testing.T) {
ms := NewMemStore("")
ms := NewSimpleStore("")
s := &Server{
storage: ms,
}
@@ -213,7 +213,7 @@ func TestUnsupportedMethod(t *testing.T) {
}
func TestNewServer(t *testing.T) {
ms := NewMemStore("")
ms := NewSimpleStore("")
sm := http.NewServeMux()
s := NewServer(sm, ms, "foo")
ts := httptest.NewServer(s)