|
|
@ -13,20 +13,28 @@ import (
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type TestLogger struct{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (t TestLogger) Debug(format string, a ...interface{}) {}
|
|
|
|
|
|
|
|
func (t TestLogger) Info(format string, a ...interface{}) {}
|
|
|
|
|
|
|
|
func (t TestLogger) Warn(format string, a ...interface{}) {}
|
|
|
|
|
|
|
|
|
|
|
|
func TestApplication(t *testing.T) {
|
|
|
|
func TestApplication(t *testing.T) {
|
|
|
|
is := is.New(t)
|
|
|
|
is := is.New(t)
|
|
|
|
|
|
|
|
logger := TestLogger{}
|
|
|
|
file_service := dataswamp.NewSwampFileService(
|
|
|
|
file_service := dataswamp.NewSwampFileService(
|
|
|
|
namespace.NewRepository(),
|
|
|
|
namespace.NewRepository(),
|
|
|
|
swampfile.NewRepository(),
|
|
|
|
swampfile.NewRepository(),
|
|
|
|
1000,
|
|
|
|
1000,
|
|
|
|
time.Hour,
|
|
|
|
time.Hour,
|
|
|
|
ServerLogger{Debug},
|
|
|
|
logger,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
bog := Bog{
|
|
|
|
bog := Bog{
|
|
|
|
router: new(http.ServeMux),
|
|
|
|
router: new(http.ServeMux),
|
|
|
|
file_service: file_service,
|
|
|
|
file_service: file_service,
|
|
|
|
address: "fake",
|
|
|
|
address: "fake",
|
|
|
|
|
|
|
|
logger: logger,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bog.routes()
|
|
|
|
bog.routes()
|
|
|
|
req := httptest.NewRequest("POST", "/apath", strings.NewReader("testdata"))
|
|
|
|
req := httptest.NewRequest("POST", "/apath", strings.NewReader("testdata"))
|
|
|
|