<commit_before>import pytest
from ostruct import OpenStruct


def test_empty_struct():
    o = OpenStruct()

    assert o == {}
    assert isinstance(o, OpenStruct)
    assert isinstance(o.__dict__, dict)

    if o:
        assert False
    else:
        assert True

    if not o:
        assert True
    else:
        assert False


def test_booleans():
    o = OpenStruct(true=True, false=False)

    assert o.true is True
    assert o.false is False
    assert isinstance(o.none, OpenStruct)


def test_shallow_struct():
    o = OpenStruct()
    o.a = 10

    assert o.a == 10<commit_msg>Added __getitem__ lookup chech to test_booleans test case<commit_after>import pytest
from ostruct import OpenStruct


def test_empty_struct():
    o = OpenStruct()

    assert o == {}
    assert isinstance(o, OpenStruct)
    assert isinstance(o.__dict__, dict)

    if o:
        assert False
    else:
        assert True

    if not o:
        assert True
    else:
        assert False


def test_booleans():
    o = OpenStruct(true=True, false=False)

    assert o.true is True
    assert o.false is False
    assert o['true'] is True
    assert o['false'] is False
    assert isinstance(o.none, OpenStruct)


def test_shallow_struct():
    o = OpenStruct()
    o.a = 10

    assert o.a == 10
{'fraction_non_alphanumeric': 0.08385093167701864, 'fraction_numerical': 0.006211180124223602, 'mean_word_length': 2.483783783783784, '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': '206505', 'n_tokens_mistral': 418, 'n_tokens_neox': 395, 'n_words': 130}