'''
    Biothings Query Component Common Tests
'''

import os

from nose.core import main

from biothings.tests import BiothingsTestCase


class QueryTests(BiothingsTestCase):
    ''' Test against server specified in environment variable BT_HOST
        and BT_API or MyGene.info production server V3 by default '''

    __test__ = True

    host = os.getenv("BT_HOST", "http://mygene.info")
    api = os.getenv("BT_API", "/v3")

    def test_01(self):
        ''' KWARGS CTRL Format Json '''
        self.query(q='*', size='1')

    def test_02(self):
        ''' KWARGS CTRL Format Yaml '''
        res = self.request('query?q=*&size=1&out_format=yaml').text
        assert res.startswith('max_score:')

    def test_03(self):
        ''' KWARGS CTRL Format Html '''
        res = self.request('query?q=*&size=1&out_format=html').text
        assert '<html>' in res

    def test_04(self):
        ''' KWARGS CTRL Format Msgpack '''
        res = self.request('query?q=*&size=1&out_format=msgpack').content
        self.msgpack_ok(res)


if __name__ == '__main__':
    main(defaultTest='__main__.QueryTests', argv=['', '-v'])

@@ -530,17 +530,23 @@
 uery(q='
-*
+__all__
 ', size=
@@ -650,33 +650,39 @@
 st('query?q=
-*
+__all__
 &size=1&
 out_format=y
@@ -665,28 +665,24 @@
 ll__&size=1&
-out_
 format=yaml'
@@ -833,33 +833,39 @@
 st('query?q=
-*
+__all__
 &size=1&
 out_format=h
@@ -848,28 +848,24 @@
 ll__&size=1&
-out_
 format=html'
@@ -1014,17 +1014,23 @@
 y?q=
-*
+__all__
 &size=1&
 out_
@@ -1029,12 +1029,8 @@
 e=1&
-out_
 form

Change match all query syntax