@cryptotaxi247 / kubo / commits / 47d45c7af

fix tests

License: MIT Signed-off-by: Ian Preston <ianopolous@protonmail.com>

Dr Ian Preston committed Nov 10, 2018 at 22:24 UTC 47d45c7af86151864ac727fd1162cb0669991bdf
1 file changed +4 -4
core/corehttp/proxy_test.go
+4 -4
@@ -9,7 +9,7 @@ import (
9 )
10
11 func TestParseRequest(t *testing.T) {
12 - url := "http://localhost:5001/proxy/http/QmT8JtU54XSmC38xSb1XHFSMm775VuTeajg7LWWWTAwzxT/test-name/path/to/index.txt"
12 + url := "http://localhost:5001/p2p/QmT8JtU54XSmC38xSb1XHFSMm775VuTeajg7LWWWTAwzxT/http/path/to/index.txt"
13 req, _ := http.NewRequest("GET", url, strings.NewReader(""))
14
15 parsed, err := parseRequest(req)
@@ -17,12 +17,12 @@ func TestParseRequest(t *testing.T) {
17 t.Error(err)
18 }
19 assert.True(parsed.httpPath == "path/to/index.txt", t, "proxy request path")
20 - assert.True(parsed.name == "test-name", t, "proxy request name")
20 + assert.True(parsed.name == "/http", t, "proxy request name")
21 assert.True(parsed.target == "QmT8JtU54XSmC38xSb1XHFSMm775VuTeajg7LWWWTAwzxT", t, "proxy request peer-id")
22 }
23
24 func TestParseRequestInvalidPath(t *testing.T) {
25 - url := "http://localhost:5001/proxy/http/foobar"
25 + url := "http://localhost:5001/p2p/http/foobar"
26 req, _ := http.NewRequest("GET", url, strings.NewReader(""))
27
28 _, err := parseRequest(req)
@@ -30,5 +30,5 @@ func TestParseRequestInvalidPath(t *testing.T) {
30 t.Fail()
31 }
32
33 - assert.True(err.Error() == "Invalid request path '/proxy/http/foobar'", t, "fails with invalid path")
33 + assert.True(err.Error() == "Invalid request path '/p2p/http/foobar'", t, "fails with invalid path")
34 }