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