couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject [9/50] git commit: Fix test test/etap/160-vhosts.t
Date Wed, 26 Oct 2011 18:05:32 GMT
Fix test test/etap/160-vhosts.t

It was broken after the vendor property was added.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/9b30323e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/9b30323e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/9b30323e

Branch: refs/heads/1319-large-headers-are-corrupted
Commit: 9b30323e4a297e98ec2a56cfac86a982d9a20c90
Parents: 43c4f12
Author: Filipe David Manana <fdmanana@apache.org>
Authored: Sat Oct 15 16:33:20 2011 +0100
Committer: Filipe David Manana <fdmanana@apache.org>
Committed: Sat Oct 15 16:33:20 2011 +0100

----------------------------------------------------------------------
 test/etap/160-vhosts.t |   39 ++++++++++-----------------------------
 1 files changed, 10 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9b30323e/test/etap/160-vhosts.t
----------------------------------------------------------------------
diff --git a/test/etap/160-vhosts.t b/test/etap/160-vhosts.t
index e959f74..6e26b59 100755
--- a/test/etap/160-vhosts.t
+++ b/test/etap/160-vhosts.t
@@ -13,28 +13,6 @@
 % License for the specific language governing permissions and limitations under
 % the License.
 
-%% XXX: Figure out how to -include("couch_rep.hrl")
--record(http_db, {
-    url,
-    auth = [],
-    resource = "",
-    headers = [
-        {"User-Agent", "CouchDB/"++couch_server:get_version()},
-        {"Accept", "application/json"},
-        {"Accept-Encoding", "gzip"}
-    ],
-    qs = [],
-    method = get,
-    body = nil,
-    options = [
-        {response_format,binary},
-        {inactivity_timeout, 30000}
-    ],
-    retries = 10,
-    pause = 1,
-    conn = nil
-}).
-
 -record(user_ctx, {
     name = null,
     roles = [],
@@ -52,7 +30,7 @@ admin_user_ctx() -> {user_ctx, #user_ctx{roles=[<<"_admin">>]}}.
 main(_) ->
     test_util:init_code_path(),
 
-    etap:plan(15),
+    etap:plan(17),
     case (catch test()) of
         ok ->
             etap:end_tests();
@@ -144,14 +122,17 @@ test() ->
     ok.
 
 test_regular_request() ->
-    Result = case ibrowse:send_req(server(), [], get, []) of
+    case ibrowse:send_req(server(), [], get, []) of
         {ok, _, _, Body} ->
-            {[{<<"couchdb">>, <<"Welcome">>},
-              {<<"version">>,_}
-            ]} = ejson:decode(Body),
-            etap:is(true, true, "should return server info");
+            {Props} = ejson:decode(Body),
+            Couchdb = couch_util:get_value(<<"couchdb">>, Props),
+            Version = couch_util:get_value(<<"version">>, Props),
+            Vendor = couch_util:get_value(<<"vendor">>, Props),
+            etap:isnt(Couchdb, undefined, "Found couchdb property"),
+            etap:isnt(Version, undefined, "Found version property"),
+            etap:isnt(Vendor, undefined, "Found vendor property");
         _Else ->
-            etap:is(false, true, <<"ibrowse fail">>)
+            etap:bail("http GET / request failed")
     end.
 
 test_vhost_request() ->


Mime
View raw message