<commit_before>"""
Test cases for stix2patterns/helpers.py.
"""
import pytest

from stix2patterns.helpers import brackets_check


@pytest.mark.parametrize(
    "value", [
        '[file:size = 1280]',
        ' [file:size = 1280]',
        '( [file:size = 1280])',
        '( ( [file:size = 1280]) )',
        '(( ( ( [file:size = 1280])) ))',
        '[',
    ],
)
def test_brackets_check(value):
    assert brackets_check(value)


def test_brackets_check_fail():
    assert not brackets_check(None)<commit_msg>Add some more failing cases to unit tests for the brackets checking.  I had simply carried over what was there before, but it really seemed insufficient...<commit_after>"""
Test cases for stix2patterns/helpers.py.
"""
import pytest

from stix2patterns.helpers import brackets_check


@pytest.mark.parametrize(
    "value", [
        '[file:size = 1280]',
        ' [file:size = 1280]',
        '( [file:size = 1280])',
        '( ( [file:size = 1280]) )',
        '(( ( ( [file:size = 1280])) ))',
        '[',
    ],
)
def test_brackets_check(value):
    assert brackets_check(value)


@pytest.mark.parametrize(
    "value", [
        None,
        "file:size = 1280",
        "(file:size = 1280)",
        " ( file:size = 1280 ) ",
        " (( (( file:size = 1280 ) )) ) ",
    ]
)
def test_brackets_check_fail(value):
    assert not brackets_check(None)
{'fraction_non_alphanumeric': 0.16216216216216217, 'fraction_numerical': 0.04382761139517896, 'mean_word_length': 2.8055555555555554, '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': '7301237', 'n_tokens_mistral': 531, 'n_tokens_neox': 473, 'n_words': 99}