<commit_before>"""Test the icat.query module.
"""

from __future__ import print_function
import sys
import pytest
import icat
import icat.config
from icat.query import Query
from conftest import icat_version, gettestdata, callscript


# Note: the number of objects returned in the queries and their
# attributes obviously depend on the content of the ICAT and need to
# be kept in sync with the reference input used in the setupicat
# fixture.


# The ICAT session as a fixture to be shared among all tests in this
# module.  The user needs appropriate read permissions.
user = "root"

@pytest.fixture(scope="module")
def client(setupicat, icatconfigfile):
    args = ["-c", icatconfigfile, "-s", user]
    conf = icat.config.Config().getconfig(args)
    client = icat.Client(conf.url, **conf.client_kwargs)
    client.login(conf.auth, conf.credentials)
    return client

<commit_msg>Remove unneeded imports.<commit_after>"""Test the icat.query module.
"""

from __future__ import print_function
import sys
import pytest
import icat
import icat.config
from icat.query import Query


# Note: the number of objects returned in the queries and their
# attributes obviously depend on the content of the ICAT and need to
# be kept in sync with the reference input used in the setupicat
# fixture.


# The ICAT session as a fixture to be shared among all tests in this
# module.  The user needs appropriate read permissions.
user = "root"

@pytest.fixture(scope="module")
def client(setupicat, icatconfigfile):
    args = ["-c", icatconfigfile, "-s", user]
    conf = icat.config.Config().getconfig(args)
    client = icat.Client(conf.url, **conf.client_kwargs)
    client.login(conf.auth, conf.credentials)
    return client


{'fraction_non_alphanumeric': 0.08536585365853659, 'fraction_numerical': 0.0, 'mean_word_length': 4.384375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5180345', 'n_tokens_mistral': 508, 'n_tokens_neox': 505, 'n_words': 202}