예제 #1
0
def test_process_command_line_invalid_package_name():
    parser = argparse.ArgumentParser()
    parser.add_argument('--name', action=ValidatingAction)
    with expect.raises_OSError(2, "Invalid string for --name: '__'"):
        parser.parse_args(['--name=__'])
예제 #2
0
def test_process_command_line_multiple_file():
    with expect.raises_OSError(2, 'Only one version file must be specified'):
        process_command_line(['test1', 'test2'])
예제 #3
0
def test_process_command_line_invalid_package_version():
    with expect.raises_OSError(2, "Invalid version string for set '__'"):
        process_command_line(['--set=__', 'test'])
예제 #4
0
def test_process_command_line_no_file():
    with expect.raises_OSError(2, 'One version file must be specified'):
        process_command_line([])
예제 #5
0
def test_process_command_line_invalid_package_name():
    with expect.raises_OSError(2, "Invalid package name string '__'"):
        process_command_line(['--name=__', 'test'])