<commit_before><commit_msg>initial tests for CLI<commit_after># -*- coding: utf-8 -*-

from cihai.cli import cli

from click.testing import CliRunner


def test_cli(test_config_file):
    runner = CliRunner()
    result = runner.invoke(cli)
    assert result.exit_code == 0
    result = runner.invoke(cli, '-c', test_config_file)
    result = runner.invoke(cli, 'info')
    assert result.exit_code == 2
    # result = runner.invoke(cli, ['info', '好'])
    # assert result.exit_code == 0

{'fraction_non_alphanumeric': 0.13552361396303902, 'fraction_numerical': 0.008213552361396304, 'mean_word_length': 3.6923076923076925, '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': '4508057', 'n_tokens_mistral': 165, 'n_tokens_neox': 157, 'n_words': 40}