<commit_before>import os
import pytest
import sys

from vent.info_tools import get_namespaces
from vent.tests import test_env

def test_init():
    """ tests argparse initialization """
    get_namespaces.set_parser()

def test_no_args():
    """ tests get_namespaces with no arguments """
    parser = get_namespaces.set_parser()
    get_namespaces.parse_args(parser.parse_args([]), parser)

def test_mimetypes_flag():
    """ tests get_namespaces using -m flag """
    parser = get_namespaces.set_parser()
    get_namespaces.parse_args(parser.parse_args(['-m']), parser)

def test_help_flag():
    """ tests get_namespaces using -h flag """
    parser = get_namespaces.set_parser()
    get_namespaces.parse_args(parser.parse_args(['-h']), parser)

def test_invalid_flag():
    """ tests get_namespaces using invalid flag """
    parser = get_namespaces.set_parser()
    get_namespaces.parse_args(parser.parse_args(['-z']), parser)

def test_main():
    """ tests the main function """
    get_namespaces.main(['get_namespaces.py'])
    tmp = sys.argv
    sys.argv = ['get_namespaces.py', '-m']
    get_namespaces.main(['get_namespaces.py', '-m'])
    sys.argv = tmp

def test_entrypoint():
    """ test the entrypoint of get_namespaces """
    path_dirs = test_env.PathDirs()
    os.system("python2.7 "+path_dirs.info_dir+"get_namespaces.py -m")
<commit_msg>expect system exit<commit_after>import os
import pytest
import sys

from vent.info_tools import get_namespaces
from vent.tests import test_env

def test_init():
    """ tests argparse initialization """
    get_namespaces.set_parser()

def test_no_args():
    """ tests get_namespaces with no arguments """
    parser = get_namespaces.set_parser()
    get_namespaces.parse_args(parser.parse_args([]), parser)

def test_mimetypes_flag():
    """ tests get_namespaces using -m flag """
    parser = get_namespaces.set_parser()
    get_namespaces.parse_args(parser.parse_args(['-m']), parser)

def test_help_flag():
    """ tests get_namespaces using -h flag """
    parser = get_namespaces.set_parser()
    with pytest.raises(SystemExit):
        get_namespaces.parse_args(parser.parse_args(['-h']), parser)

def test_invalid_flag():
    """ tests get_namespaces using invalid flag """
    parser = get_namespaces.set_parser()
    with pytest.raises(SystemExit):
        get_namespaces.parse_args(parser.parse_args(['-z']), parser)

def test_main():
    """ tests the main function """
    get_namespaces.main(['get_namespaces.py'])
    tmp = sys.argv
    sys.argv = ['get_namespaces.py', '-m']
    get_namespaces.main(['get_namespaces.py', '-m'])
    sys.argv = tmp

def test_entrypoint():
    """ test the entrypoint of get_namespaces """
    path_dirs = test_env.PathDirs()
    os.system("python2.7 "+path_dirs.info_dir+"get_namespaces.py -m")

{'fraction_non_alphanumeric': 0.1354723707664884, 'fraction_numerical': 0.00142602495543672, 'mean_word_length': 4.344761904761905, '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': '6174221', 'n_tokens_mistral': 909, 'n_tokens_neox': 914, 'n_words': 190}