~andychilton/goamz/aws-fix-for-r60

« back to all changes in this revision

Viewing changes to suite_test.go

  • Committer: Andrew Chilton
  • Date: 2011-09-10 05:40:48 UTC
  • Revision ID: andychilton@gmail.com-20110910054048-ksl8fhbr2qqjscqr
Fix for the new url package in r60

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
        "os"
10
10
        "testing"
11
11
        "time"
 
12
        "url"
12
13
)
13
14
 
14
15
func Test(t *testing.T) {
36
37
 
37
38
var testServer = NewTestHTTPServer("http://localhost:4444", 5e9)
38
39
 
39
 
 
40
40
func (s *HTTPSuite) SetUpSuite(c *C) {
41
41
        testServer.Start()
42
42
}
60
60
        Body    string
61
61
}
62
62
 
63
 
func NewTestHTTPServer(url string, timeout int64) *TestHTTPServer {
64
 
        return &TestHTTPServer{URL: url, Timeout: timeout}
 
63
func NewTestHTTPServer(url_ string, timeout int64) *TestHTTPServer {
 
64
        return &TestHTTPServer{URL: url_, Timeout: timeout}
65
65
}
66
66
 
67
67
func (s *TestHTTPServer) Start() {
74
74
        s.response = make(chan *testResponse, 64)
75
75
        s.pending = make(chan bool, 64)
76
76
 
77
 
        url, _ := http.ParseURL(s.URL)
 
77
        url, _ := url.Parse(s.URL)
78
78
        go http.ListenAndServe(url.Host, s)
79
79
 
80
80
        s.PrepareResponse(123, nil, "")