<commit_before>import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map


# Namespaces that are not currently handled but still appear in statements
exceptions = ['CLO']

def test_misgrounding_map_entries():
    bad_entries = []
    for text, db_refs in default_misgrounding_map.items():
        if not validate_db_refs(db_refs):
            bad_entries.append([text, db_refs])
    assert not bad_entries, bad_entries


def test_grounding_map_entries():
    bad_entries = []
    for text, db_refs in default_grounding_map.items():
        if (not validate_db_refs(db_refs) and
            not (set(exceptions) & db_refs.keys())):
            bad_entries.append([text, db_refs])
    assert not bad_entries, bad_entries


def test_exceptional_unhandled():
    """Test that exceptional namespaces actually aren't handled.

    This will catch if we make an update that makes an exceptional namespace
    become a handled namespace. That way we can update the tests.
    """
    actually_handled = []
    for ns in exceptions:
        if validate_ns(ns):
            actually_handled.append(ns)
    assert not actually_handled, actually_handled






<commit_msg>Remove exceptional namespaces from test<commit_after>import os
import csv
from indra.statements.validate import validate_db_refs, validate_ns
from indra.preassembler.grounding_mapper import default_grounding_map
from indra.preassembler.grounding_mapper import default_misgrounding_map


def test_misgrounding_map_entries():
    bad_entries = []
    for text, db_refs in default_misgrounding_map.items():
        if not validate_db_refs(db_refs):
            bad_entries.append([text, db_refs])
    assert not bad_entries, bad_entries


def test_grounding_map_entries():
    bad_entries = []
    for text, db_refs in default_grounding_map.items():
        if (not validate_db_refs(db_refs) and
            not (set(exceptions) & db_refs.keys())):
            bad_entries.append([text, db_refs])
    assert not bad_entries, bad_entries

{'fraction_non_alphanumeric': 0.07103321033210332, 'fraction_numerical': 0.0, 'mean_word_length': 4.020833333333333, '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': '4997627', 'n_tokens_mistral': 673, 'n_tokens_neox': 637, 'n_words': 172}