Add test for accessing unimplemented methods
This commit is contained in:
parent
474c78b79d
commit
a7e4fcc42e
15
get_test.go
15
get_test.go
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue