File: test_configuration.py

package info (click to toggle)
python-milc 1.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 788 kB
  • sloc: python: 1,868; sh: 55; makefile: 3
file content (31 lines) | stat: -rw-r--r-- 1,011 bytes parent folder | download
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']