Add test for accessing unimplemented methods

This commit is contained in:
Marius 2016-10-13 18:48:46 +02:00
parent 474c78b79d
commit a7e4fcc42e
2 changed files with 18 additions and 3 deletions

View File

@ -90,4 +90,19 @@ func TestGet(t *testing.T) {
ResBody: "", ResBody: "",
}).Run(handler, t) }).Run(handler, t)
}) })
SubTest(t, "NotProvided", func(t *testing.T, store *MockFullDataStore) {
composer := NewStoreComposer()
composer.UseCore(store)
handler, _ := NewUnroutedHandler(Config{
StoreComposer: composer,
})
(&httpTest{
Method: "GET",
URL: "foo",
Code: http.StatusNotImplemented,
}).Run(http.HandlerFunc(handler.GetFile), t)
})
} }

View File

@ -77,7 +77,7 @@ func TestTerminate(t *testing.T) {
composer := NewStoreComposer() composer := NewStoreComposer()
composer.UseCore(store) composer.UseCore(store)
handler, _ := NewHandler(Config{ handler, _ := NewUnroutedHandler(Config{
StoreComposer: composer, StoreComposer: composer,
}) })
@ -87,7 +87,7 @@ func TestTerminate(t *testing.T) {
ReqHeader: map[string]string{ ReqHeader: map[string]string{
"Tus-Resumable": "1.0.0", "Tus-Resumable": "1.0.0",
}, },
Code: http.StatusMethodNotAllowed, Code: http.StatusNotImplemented,
}).Run(handler, t) }).Run(http.HandlerFunc(handler.DelFile), t)
}) })
} }