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