Skip to content

Commit

Permalink
Add test for accessing unimplemented methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Acconut committed Oct 13, 2016
1 parent 474c78b commit a7e4fcc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
6 changes: 3 additions & 3 deletions terminate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestTerminate(t *testing.T) {
composer := NewStoreComposer()
composer.UseCore(store)

handler, _ := NewHandler(Config{
handler, _ := NewUnroutedHandler(Config{
StoreComposer: composer,
})

Expand All @@ -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)
})
}

0 comments on commit a7e4fcc

Please sign in to comment.