Example #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'
Example #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'
Example #3
0
def test_parse_single_arg_gets_first_key():
    assert parse_single_arg(['dbt', 'run', '--target=prod', '-t=a'],
                            ['-t', '--target']) == 'a'
Example #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