[ARVADOS] updated: 91b7b7fd54c4728ac6cf12181efc1fed60157ecb

git at public.curoverse.com git at public.curoverse.com
Fri Jul 17 15:44:06 EDT 2015


Summary of changes:
 services/datamanager/keep/keep_test.go | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

       via  91b7b7fd54c4728ac6cf12181efc1fed60157ecb (commit)
      from  f51b562b9def7f6bc17e0cc52b60ffc2641d40b5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 91b7b7fd54c4728ac6cf12181efc1fed60157ecb
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri Jul 17 15:44:49 2015 -0400

    6221: Pass server to sendTrashListError(), use NewUnstartedServer()

diff --git a/services/datamanager/keep/keep_test.go b/services/datamanager/keep/keep_test.go
index 2bf37c8..08de024 100644
--- a/services/datamanager/keep/keep_test.go
+++ b/services/datamanager/keep/keep_test.go
@@ -57,12 +57,7 @@ func (this *TestHandlerError) ServeHTTP(writer http.ResponseWriter, req *http.Re
 	http.Error(writer, "I'm a teapot", 418)
 }
 
-func sendTrashListError(c *C, close_early bool, th http.Handler) {
-	server := httptest.NewServer(th)
-	if close_early {
-		server.Close()
-	}
-
+func sendTrashListError(c *C, server *httptest.Server) {
 	tl := map[string]TrashList{
 		server.URL: TrashList{TrashRequest{"000000000000000000000000deadbeef", 99}}}
 
@@ -72,17 +67,14 @@ func sendTrashListError(c *C, close_early bool, th http.Handler) {
 		map[string]string{})
 
 	err := SendTrashLists("", &kc, tl)
-	if !close_early {
-		server.Close()
-	}
 
 	c.Check(err[0], NotNil)
 }
 
 func (s *KeepSuite) TestSendTrashListErrorResponse(c *C) {
-	sendTrashListError(c, false, &TestHandlerError{})
+	sendTrashListError(c, httptest.NewServer(&TestHandlerError{}))
 }
 
 func (s *KeepSuite) TestSendTrashListUnreachable(c *C) {
-	sendTrashListError(c, true, &TestHandler{})
+	sendTrashListError(c, httptest.NewUnstartedServer(&TestHandler{}))
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list