Prechádzať zdrojové kódy

Update broken tests from depency update

Andrew Swistak 6 rokov pred
rodič
commit
7c13332daa
2 zmenil súbory, kde vykonal 4 pridanie a 5 odobranie
  1. 1 1
      web/parse_integration_test.go
  2. 3 4
      web/server_test.go

+ 1 - 1
web/parse_integration_test.go

@@ -70,7 +70,7 @@ func Test_parse(t *testing.T) {
 			w := multipart.NewWriter(&b)
 
 			for i, postBody := range tt.body {
-				if fw, err = w.CreateFormFile("pkmn[]", fmt.Sprintf("test%d.pk7", i+1)); err != nil {
+				if fw, err = w.CreateFormFile("pokemon", fmt.Sprintf("test%d.pk7", i+1)); err != nil {
 					assert.Fail(t, "Failed to create form file: %s", err)
 					return
 				}

+ 3 - 4
web/server_test.go

@@ -3,14 +3,13 @@ package web
 import (
 	"testing"
 
-	"github.com/gin-gonic/gin"
 	"github.com/stretchr/testify/assert"
 )
 
 func TestNewServer_routes(t *testing.T) {
 	s := NewServer()
 	routes := s.router.Routes()
-	checkedRoutes := make(map[gin.RouteInfo]bool)
+	checkedRoutes := make(map[string]bool)
 
 	tests := []struct {
 		path    string
@@ -31,7 +30,7 @@ func TestNewServer_routes(t *testing.T) {
 				})
 
 				ran = true
-				checkedRoutes[route] = true
+				checkedRoutes[route.Path] = true
 				break
 			}
 		}
@@ -41,7 +40,7 @@ func TestNewServer_routes(t *testing.T) {
 	}
 
 	for _, route := range routes {
-		if !checkedRoutes[route] {
+		if !checkedRoutes[route.Path] {
 			assert.Failf(t, "Unchecked route", "Didn't check %s", route.Path)
 		}
 	}