1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
"""Unit tests for milc.configuration.
"""
import argparse
import milc.configuration
arg_parser = argparse.ArgumentParser(description='Minimal argparser.')
def test_get_argument_names_optional():
"""Make sure we can get optional names from get_argument_strings.
"""
assert milc.configuration.get_argument_name(arg_parser, '-v', '--verbose') == 'verbose'
def test_get_argument_names_positional():
"""Make sure we can get positional names from get_argument_strings.
"""
assert milc.configuration.get_argument_name(arg_parser, 'files') == 'files'
def test_get_argument_strings_optional():
"""Make sure we can get optional names from get_argument_strings.
"""
assert milc.configuration.get_argument_strings(arg_parser, '-v', '--verbose') == ['-v', '--verbose']
def test_get_argument_strings_positional():
"""Make sure we can get positional names from get_argument_strings.
"""
assert milc.configuration.get_argument_strings(arg_parser, 'files') == ['files']
|