Unify naming of subtests
This commit is contained in:
parent
58f7065e61
commit
6a3b51f491
|
@ -24,7 +24,7 @@ var reader = &closingStringReader{
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGet(t *testing.T) {
|
func TestGet(t *testing.T) {
|
||||||
SubTest(t, "Successful download", func(t *testing.T, store *MockFullDataStore) {
|
SubTest(t, "Download", func(t *testing.T, store *MockFullDataStore) {
|
||||||
gomock.InOrder(
|
gomock.InOrder(
|
||||||
store.EXPECT().GetInfo("yes").Return(FileInfo{
|
store.EXPECT().GetInfo("yes").Return(FileInfo{
|
||||||
Offset: 5,
|
Offset: 5,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHead(t *testing.T) {
|
func TestHead(t *testing.T) {
|
||||||
SubTest(t, "Successful HEAD request", func(t *testing.T, store *MockFullDataStore) {
|
SubTest(t, "Status", func(t *testing.T, store *MockFullDataStore) {
|
||||||
store.EXPECT().GetInfo("yes").Return(FileInfo{
|
store.EXPECT().GetInfo("yes").Return(FileInfo{
|
||||||
Offset: 11,
|
Offset: 11,
|
||||||
Size: 44,
|
Size: 44,
|
||||||
|
@ -24,7 +24,6 @@ func TestHead(t *testing.T) {
|
||||||
})
|
})
|
||||||
|
|
||||||
res := (&httpTest{
|
res := (&httpTest{
|
||||||
Name: "Successful request",
|
|
||||||
Method: "HEAD",
|
Method: "HEAD",
|
||||||
URL: "yes",
|
URL: "yes",
|
||||||
ReqHeader: map[string]string{
|
ReqHeader: map[string]string{
|
||||||
|
@ -46,7 +45,7 @@ func TestHead(t *testing.T) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
SubTest(t, "Non-existing file", func(t *testing.T, store *MockFullDataStore) {
|
SubTest(t, "UploadNotFoundFail", func(t *testing.T, store *MockFullDataStore) {
|
||||||
store.EXPECT().GetInfo("no").Return(FileInfo{}, os.ErrNotExist)
|
store.EXPECT().GetInfo("no").Return(FileInfo{}, os.ErrNotExist)
|
||||||
|
|
||||||
handler, _ := NewHandler(Config{
|
handler, _ := NewHandler(Config{
|
||||||
|
|
Loading…
Reference in New Issue