Merge branch 'master' into 3762-delete-list-worker
[arvados.git] / services / keepstore / handler_test.go
index a954d2b0385d82dfe3e33303898cb297630e25a7..9ad77bfba7d66aab717dc1fbfd1dc37bc57a6edc 100644 (file)
@@ -81,10 +81,11 @@ func TestGetHandler(t *testing.T) {
                "Unauthenticated request, unsigned locator",
                string(TEST_BLOCK),
                response)
-       received_xbs := response.Header().Get("X-Block-Size")
-       expected_xbs := fmt.Sprintf("%d", len(TEST_BLOCK))
-       if received_xbs != expected_xbs {
-               t.Errorf("expected X-Block-Size %s, got %s", expected_xbs, received_xbs)
+
+       received_cl := response.Header().Get("Content-Length")
+       expected_cl := fmt.Sprintf("%d", len(TEST_BLOCK))
+       if received_cl != expected_cl {
+               t.Errorf("expected Content-Length %s, got %s", expected_cl, received_cl)
        }
 
        // ----------------
@@ -102,10 +103,11 @@ func TestGetHandler(t *testing.T) {
                "Authenticated request, signed locator", http.StatusOK, response)
        ExpectBody(t,
                "Authenticated request, signed locator", string(TEST_BLOCK), response)
-       received_xbs = response.Header().Get("X-Block-Size")
-       expected_xbs = fmt.Sprintf("%d", len(TEST_BLOCK))
-       if received_xbs != expected_xbs {
-               t.Errorf("expected X-Block-Size %s, got %s", expected_xbs, received_xbs)
+
+       received_cl = response.Header().Get("Content-Length")
+       expected_cl = fmt.Sprintf("%d", len(TEST_BLOCK))
+       if received_cl != expected_cl {
+               t.Errorf("expected Content-Length %s, got %s", expected_cl, received_cl)
        }
 
        // Authenticated request, unsigned locator
@@ -543,6 +545,8 @@ func TestPullHandler(t *testing.T) {
        var user_token = "USER TOKEN"
        data_manager_token = "DATA MANAGER TOKEN"
 
+       pullq = NewWorkQueue()
+
        good_json := []byte(`[
                {
                        "locator":"locator_with_two_servers",
@@ -647,6 +651,8 @@ func TestTrashHandler(t *testing.T) {
        var user_token = "USER TOKEN"
        data_manager_token = "DATA MANAGER TOKEN"
 
+       trashq = NewWorkQueue()
+
        good_json := []byte(`[
                {
                        "locator":"block1",