<commit_before>import sys
sys.path.append('../orgmode2json')
import pytest
from io import IOBase
from orgmode2json import *


def test_filename0():
    """
    Test to handle a valid filename. This should return a file object and not
    cause any trouble.
    """
    o2j = Orgmode2json()
    ofile = o2j.open_jsonfile('tests/test.json')
    if not isinstance(ofile, IOBase):
        pytest.fail("no file object returned")
    ofile.close()


def test_filename1():
    """
    Test to handle non-string (int) as filename. This should fail with a
    TypeError.
    """
    o2j = Orgmode2json()
    with pytest.raises(TypeError):<commit_msg>type fixed<commit_after>import sys
sys.path.append('../orgmode2json')
import pytest
from io import TextIOWrapper
from orgmode2json import *


def test_filename0():
    """
    Test to handle a valid filename. This should return a file object and not
    cause any trouble.
    """
    o2j = Orgmode2json()
    ofile = o2j.open_jsonfile('tests/test.json')
    if not isinstance(ofile, TextIOWrapper):
        pytest.fail("no file object returned")
    ofile.close()


def test_filename1():
    """
    Test to handle non-string (int) as filename. This should fail with a
    TypeError.
    """
    o2j = Orgmode2json()
    with pytest.raises(TypeError):
{'fraction_non_alphanumeric': 0.10518174787316319, 'fraction_numerical': 0.013921113689095127, 'mean_word_length': 3.174193548387097, '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': '3922364', 'n_tokens_mistral': 414, 'n_tokens_neox': 417, 'n_words': 126}