Exemplo n.º 1
0
def w_process_with_linter(context, name, linter):
    file_type = versionah.process_command_line([name, ])[0].file_type
    context.version.write("tests/data/%s" % name, file_type)
    context.retval = subprocess.call(
        linter.split() + ["tests/data/%s" % name, ],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE
    )
    os.unlink("tests/data/%s" % name)
Exemplo n.º 2
0
def w_process_with_linter(context, name, linter):
    file_type = versionah.process_command_line([
        name,
    ])[0].file_type
    context.version.write("tests/data/%s" % name, file_type)
    context.retval = subprocess.call(linter.split() + [
        "tests/data/%s" % name,
    ],
                                     stdout=subprocess.PIPE,
                                     stderr=subprocess.PIPE)
    os.unlink("tests/data/%s" % name)
Exemplo n.º 3
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'])
Exemplo n.º 4
0
def test_process_command_line_no_file():
    with expect.raises_OSError(2, 'One version file must be specified'):
        process_command_line([])
Exemplo n.º 5
0
def test_process_command_line_invalid_package_version():
    with expect.raises_OSError(2, "Invalid version string for set '__'"):
        process_command_line(['--set=__', 'test'])
Exemplo n.º 6
0
def test_process_command_line_invalid_package_name():
    with expect.raises_OSError(2, "Invalid package name string '__'"):
        process_command_line(['--name=__', 'test'])