Example #1
0
def ensure_cratedb_layer():
    """
    In order to skip individual tests by manually disabling them within
    `def test_suite()`, it is crucial make the test layer not run on each
    and every occasion. So, things like this will be possible::

        ./bin/test -vvvv --ignore_dir=testing

    TODO: Through a subsequent patch, the possibility to individually
          unselect specific tests might be added to `def test_suite()`
          on behalf of environment variables.
          A blueprint for this kind of logic can be found at
          https://github.com/crate/crate/commit/414cd833.
    """
    global crate_layer

    if crate_layer is None:
        crate_layer = CrateLayer('crate',
                                 crate_home=crate_path(),
                                 port=crate_port,
                                 host=local,
                                 transport_port=crate_transport_port,
                                 settings=settings)
    return crate_layer
Example #2
0
    def set_next_response(self, response):
        self.response = response

    def set_next_server_infos(self, server, server_name, version):
        self._server_infos = (server, server_name, version)


def setUpMocked(test):
    test.globs['connection_client_mocked'] = ClientMocked()


crate_port = 44209
crate_transport_port = 44309
crate_layer = CrateLayer('crate',
                         crate_home=crate_path(),
                         port=crate_port,
                         transport_port=crate_transport_port)

crate_host = "127.0.0.1:{port}".format(port=crate_port)
crate_uri = "http://%s" % crate_host


def setUpWithCrateLayer(test):
    test.globs['HttpClient'] = http.Client
    test.globs['crate_host'] = crate_host
    test.globs['pprint'] = pprint
    test.globs['print'] = cprint

    conn = connect(crate_host)
    cursor = conn.cursor()
Example #3
0
    def set_next_response(self, response):
        self.response = response

    def set_next_server_infos(self, server, server_name, version):
        self._server_infos = (server, server_name, version)


def setUpMocked(test):
    test.globs['connection_client_mocked'] = ClientMocked()


crate_port = 44209
crate_transport_port = 44309
crate_layer = CrateLayer('crate',
                         crate_home=crate_path(),
                         crate_exec=crate_path('bin', 'crate'),
                         port=crate_port,
                         transport_port=crate_transport_port)

crate_host = "127.0.0.1:{port}".format(port=crate_port)
crate_uri = "http://%s" % crate_host


def setUpWithCrateLayer(test):
    test.globs['HttpClient'] = http.Client
    test.globs['crate_host'] = crate_host
    test.globs['pprint'] = pprint
    test.globs['print'] = cprint

    conn = connect(crate_host)
Example #4
0
    def set_next_response(self, response):
        self.response = response

    def set_next_server_infos(self, server, server_name, version):
        self._server_infos = (server, server_name, version)


def setUpMocked(test):
    test.globs['connection_client_mocked'] = ClientMocked()


crate_port = 44209
crate_transport_port = 44309
crate_layer = CrateLayer('crate',
                         crate_home=crate_path(),
                         port=crate_port,
                         transport_port=crate_transport_port)

crate_host = "127.0.0.1:{port}".format(port=crate_port)
crate_uri = "http://%s" % crate_host


def setUpForDjango(test):
    connect(crate_host)
    import os
    os.environ["DJANGO_SETTINGS_MODULE"] = "crate.client.django.tests.settings"

    from django.test.runner import setup_databases
    setup_databases(3, False)
Example #5
0
    def set_next_response(self, response):
        self.response = response

    def set_next_server_infos(self, server, server_name, version):
        self._server_infos = (server, server_name, version)


def setUpMocked(test):
    test.globs['connection_client_mocked'] = ClientMocked()


crate_port = 44209
crate_transport_port = 44309
crate_layer = CrateLayer('crate',
                         crate_home=crate_path(),
                         crate_exec=crate_path('bin', 'crate'),
                         port=crate_port,
                         transport_port=crate_transport_port)

crate_host = "127.0.0.1:{port}".format(port=crate_port)
crate_uri = "http://%s" % crate_host


def setUpWithCrateLayer(test):
    test.globs['HttpClient'] = http.Client
    test.globs['crate_host'] = crate_host
    test.globs['pprint'] = pprint
    test.globs['print'] = cprint

    conn = connect(crate_host)
Example #6
0
    def sql(self, stmt=None, parameters=None):
        return self.response

    def set_next_response(self, response):
        self.response = response


def setUpMocked(test):
    test.globs["connection_client_mocked"] = ClientMocked()


crate_port = 44209
crate_transport_port = 44309
crate_layer = CrateLayer(
    "crate",
    crate_home=crate_path(),
    crate_exec=crate_path("bin", "crate"),
    port=crate_port,
    transport_port=crate_transport_port,
)

crate_host = "127.0.0.1:{port}".format(port=crate_port)
crate_uri = "http://%s" % crate_host


def setUpWithCrateLayer(test):
    test.globs["HttpClient"] = http.Client
    test.globs["crate_host"] = crate_host
    test.globs["pprint"] = pprint
    test.globs["print"] = cprint