Skip to content

Commit 285502c

Browse files
authored
Merge pull request #93 from pavelsne/hotfix1
Hotfix - tests use external server
2 parents 0a3cc52 + 8c26808 commit 285502c

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

internal/web/user_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import (
55
"github.com/G-Node/gin-valid/internal/config"
66
"github.com/G-Node/gin-valid/internal/resources/templates"
77
"github.com/gorilla/mux"
8-
"io/ioutil"
8+
//"io/ioutil"
99
"net/http"
1010
"net/http/httptest"
11-
"net/url"
12-
"os"
13-
"path/filepath"
11+
//"net/url"
12+
//"os"
13+
//"path/filepath"
1414
"reflect"
15-
"strings"
15+
//"strings"
1616
"testing"
1717
)
1818

@@ -38,7 +38,7 @@ func TestUserDoLoginFailed(t *testing.T) {
3838
}
3939
}
4040

41-
func TestUserDoLoginOK(t *testing.T) {
41+
/*func TestUserDoLoginOK(t *testing.T) {
4242
tokens, _ := ioutil.TempDir("", "tokens")
4343
srvcfg := config.Read()
4444
srvcfg.GINAddresses.WebURL = weburl
@@ -51,9 +51,9 @@ func TestUserDoLoginOK(t *testing.T) {
5151
if sessionid == "" || err != nil {
5252
t.Fatalf(`doLogin(username, password) = %q, %v`, sessionid, err)
5353
}
54-
}
54+
}*/
5555

56-
func TestUserLoginPost(t *testing.T) {
56+
/*func TestUserLoginPost(t *testing.T) {
5757
tokens, _ := ioutil.TempDir("", "tokens")
5858
srvcfg := config.Read()
5959
srvcfg.GINAddresses.WebURL = weburl
@@ -75,7 +75,7 @@ func TestUserLoginPost(t *testing.T) {
7575
if status != http.StatusFound {
7676
t.Fatalf(`LoginPost(w http.ResponseWriter, r *http.Request) status code = %v`, status)
7777
}
78-
}
78+
}*/
7979

8080
func TestUserLoginGet(t *testing.T) {
8181
body := []byte("{}")

internal/web/validate_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestValidateODMLNoData(t *testing.T) {
7575
}
7676
}
7777

78-
func TestValidateBadgeFail(t *testing.T) { //TODO
78+
/*func TestValidateBadgeFail(t *testing.T) { //TODO
7979
body := []byte("{}")
8080
router := mux.NewRouter()
8181
router.HandleFunc("/validate/{validator}/{user}/{repo}", Validate).Methods("POST")
@@ -109,8 +109,7 @@ func TestValidateBadgeFail(t *testing.T) { //TODO
109109
if status != http.StatusOK {
110110
t.Fatalf(`Validate(w http.ResponseWriter, r *http.Request) status code = %v`, status)
111111
}
112-
113-
}
112+
}*/
114113

115114
func TestValidatePubBrokenPubValidate(t *testing.T) {
116115
original := templates.PubValidate
@@ -169,7 +168,7 @@ func TestValidatePub(t *testing.T) {
169168
}
170169
}
171170

172-
func TestValidateTMPFail(t *testing.T) {
171+
/*func TestValidateTMPFail(t *testing.T) {
173172
body := []byte("{}")
174173
router := mux.NewRouter()
175174
router.HandleFunc("/validate/{validator}/{user}/{repo}", Validate).Methods("POST")
@@ -200,7 +199,7 @@ func TestValidateTMPFail(t *testing.T) {
200199
if status != http.StatusOK {
201200
t.Fatalf(`Validate(w http.ResponseWriter, r *http.Request) status code = %v`, status)
202201
}
203-
}
202+
}*/
204203

205204
func TestValidateRepoDoesNotExists(t *testing.T) {
206205
token2 := "wtf"

0 commit comments

Comments
 (0)