コード例 #1
0
def test_mimetypes_flag():
    """ tests get_namespaces using -m flag """
    path_dirs = test_env.PathDirs()
    parser = get_namespaces.set_parser()
    get_namespaces.parse_args(parser.parse_args(['-m']), parser)
    get_namespaces.parse_args(
        parser.parse_args(['-m', '-t', path_dirs.template_dir]), parser)
コード例 #2
0
def test_init():
    """ tests argparse initialization """
    get_namespaces.set_parser()
コード例 #3
0
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)
コード例 #4
0
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)
コード例 #5
0
def test_template_dir_flag():
    """ tests get_namespaces using -t flag """
    parser = get_namespaces.set_parser()
    with pytest.raises(SystemExit):
        get_namespaces.parse_args(parser.parse_args(['-t']), parser)
コード例 #6
0
def test_mimetypes_flag():
    """ tests get_namespaces using -m flag """
    path_dirs = test_env.PathDirs()
    parser = get_namespaces.set_parser()
    get_namespaces.parse_args(parser.parse_args(['-m']), parser)
    get_namespaces.parse_args(parser.parse_args(['-m', '-t', path_dirs.template_dir]), parser)
コード例 #7
0
def test_no_args():
    """ tests get_namespaces with no arguments """
    parser = get_namespaces.set_parser()
    get_namespaces.parse_args(parser.parse_args([]), parser)
コード例 #8
0
def test_init():
    """ tests argparse initialization """
    get_namespaces.set_parser()
コード例 #9
0
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)
コード例 #10
0
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)
コード例 #11
0
def test_template_dir_flag():
    """ tests get_namespaces using -t flag """
    parser = get_namespaces.set_parser()
    with pytest.raises(SystemExit):
        get_namespaces.parse_args(parser.parse_args(['-t']), parser)
コード例 #12
0
def test_no_args():
    """ tests get_namespaces with no arguments """
    parser = get_namespaces.set_parser()
    get_namespaces.parse_args(parser.parse_args([]), parser)