<commit_before># I should split in two tests, one for generic expected proprieties and
#   contents, and another test for specific contents, like keys, and values
#   itself. But this last one must require a md5.

import numpy as np

def func(datafile):
    from seabird import cnv
    import cotede.qc
    data = cnv.fCNV(datafile)
    pqc = cotede.qc.ProfileQC(data, saveauxiliary=True)
    return pqc


def test_answer():
    datafile = "./tests/dPIRX010.cnv"
    pqc = func(datafile=datafile)
    assert type(pqc.keys()) == list
    assert type(pqc.attributes) == dict
    assert hasattr(pqc, 'input')
    assert hasattr(pqc, 'flags')
    assert hasattr(pqc, 'auxiliary')
    assert type(pqc.flags) == dict
    for k in pqc.flags.keys():
        assert type(pqc.flags[k]) == dict
        for kk in pqc.flags[k].keys():
            assert (type(pqc.flags[k][kk]) == np.ndarray) or \
                (type(pqc.flags[k][kk]) == bool)
            if (type(pqc.flags[k][kk]) == np.ndarray):
                assert pqc.flags[k][kk].dtype == 'int8'<commit_msg>Bugfix, common flags are now int, not bool anymore.<commit_after># I should split in two tests, one for generic expected proprieties and
#   contents, and another test for specific contents, like keys, and values
#   itself. But this last one must require a md5.

import numpy as np

def func(datafile):
    from seabird import cnv
    import cotede.qc
    data = cnv.fCNV(datafile)
    pqc = cotede.qc.ProfileQC(data, saveauxiliary=True)
    return pqc


def test_answer():
    datafile = "./tests/dPIRX010.cnv"
    pqc = func(datafile=datafile)
    assert type(pqc.keys()) == list
    assert type(pqc.attributes) == dict
    assert hasattr(pqc, 'input')
    assert hasattr(pqc, 'flags')
    assert hasattr(pqc, 'auxiliary')
    assert type(pqc.flags) == dict
    for k in pqc.flags.keys():
        assert type(pqc.flags[k]) == dict
        for kk in pqc.flags[k].keys():
            assert (type(pqc.flags[k][kk]) == np.ndarray) or \
                (type(pqc.flags[k][kk]) == int)
            if (type(pqc.flags[k][kk]) == np.ndarray):
                assert pqc.flags[k][kk].dtype == 'int8'
{'fraction_non_alphanumeric': 0.1306369130636913, 'fraction_numerical': 0.004649000464900047, 'mean_word_length': 2.842857142857143, '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': '1036243', 'n_tokens_mistral': 773, 'n_tokens_neox': 729, 'n_words': 205}