示例#1
0
def test_parse_single_arg_default():
    assert parse_single_arg(['dbt', 'run'], ['-t', '--target']) is None
    assert parse_single_arg(['dbt', 'run'], ['-t', '--target'],
                            default='prod') == 'prod'
示例#2
0
def test_parse_single_arg_equals():
    assert parse_single_arg(['dbt', 'run', '--target=prod'],
                            ['-t', '--target']) == 'prod'
    assert parse_single_arg(['python', '--random=yes', '--what=asdf'],
                            ['--what']) == 'asdf'
示例#3
0
def test_parse_single_arg_gets_first_key():
    assert parse_single_arg(['dbt', 'run', '--target=prod', '-t=a'],
                            ['-t', '--target']) == 'a'
示例#4
0
def test_parse_single_arg_does_not_exist():
    assert parse_single_arg(['dbt', 'run'], ['-t', '--target']) is None
    assert parse_single_arg(['python', 'main.py', '--random_arg', 'yes'],
                            ['--what']) is None