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)
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)
def test_process_command_line_multiple_file(): with expect.raises_OSError(2, 'Only one version file must be specified'): process_command_line(['test1', 'test2'])
def test_process_command_line_no_file(): with expect.raises_OSError(2, 'One version file must be specified'): process_command_line([])
def test_process_command_line_invalid_package_version(): with expect.raises_OSError(2, "Invalid version string for set '__'"): process_command_line(['--set=__', 'test'])
def test_process_command_line_invalid_package_name(): with expect.raises_OSError(2, "Invalid package name string '__'"): process_command_line(['--name=__', 'test'])