<commit_before>from __future__ import absolute_import, division, print_function

import pytest

from xia2.Handlers.CommandLine import validate_project_crystal_name
from dials.util import Sorry


def test_validate_project_crystal_name():
    for value in ("foo_001", "_foo_001", "foo", "_foo_", "_1foo"):
        assert validate_project_crystal_name("crystal", value)
    for value in ("foo.001", "1foo", "foo&", "*foo"):
        with pytest.raises(Sorry):
            validate_project_crystal_name("crystal", value)
<commit_msg>test relies on syminfo.py, which needs CLIBD<commit_after>from __future__ import absolute_import, division, print_function

import pytest

from xia2.Handlers.CommandLine import validate_project_crystal_name
from dials.util import Sorry


def test_validate_project_crystal_name(ccp4):
    for value in ("foo_001", "_foo_001", "foo", "_foo_", "_1foo"):
        assert validate_project_crystal_name("crystal", value)
    for value in ("foo.001", "1foo", "foo&", "*foo"):
        with pytest.raises(Sorry):
            validate_project_crystal_name("crystal", value)

{'fraction_non_alphanumeric': 0.10999083409715857, 'fraction_numerical': 0.022914757103574702, 'mean_word_length': 5.134831460674158, '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': '3801008', 'n_tokens_mistral': 368, 'n_tokens_neox': 349, 'n_words': 86}