示例#1
0
def test_get_ghostscript_binary_windows(pretend_windows, pretend_have_windows_ghostscript):
    assert treepoem._get_ghostscript_binary() == 'gswin32c'
示例#2
0
def test_get_ghostscript_binary_windows_missing(pretend_windows):
    with pytest.raises(treepoem.TreepoemError) as excinfo:
        treepoem._get_ghostscript_binary()
    assert 'Cannot determine path to ghostscript' in str(excinfo.value)
示例#3
0
def test_get_ghostscript_binary_windows(pretend_windows, pretend_have_windows_ghostscript):
    assert treepoem._get_ghostscript_binary() == 'gswin32c'
示例#4
0
def test_get_ghostscript_binary_windows_missing(pretend_windows):
    with pytest.raises(treepoem.TreepoemError) as excinfo:
        treepoem._get_ghostscript_binary()
    assert 'Cannot determine path to ghostscript' in str(excinfo.value)
示例#5
0
# -*- coding:utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals

import re
import subprocess
import sys

from treepoem import _get_ghostscript_binary

GHOSTSCRIPT_VERSION = subprocess.check_output([
    _get_ghostscript_binary(),
    '--version',
]).decode('utf-8')
if not re.match(r'9\.\d\d', GHOSTSCRIPT_VERSION):
    print(
        "Ghostscript must be version 9.X, have {}".format(GHOSTSCRIPT_VERSION),
    )
    sys.exit(1)


def pytest_report_header(config):
    return "Ghostscript version: {}".format(GHOSTSCRIPT_VERSION)
示例#6
0
# -*- coding:utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals

import re
import subprocess
import sys

from treepoem import _get_ghostscript_binary

GHOSTSCRIPT_VERSION = subprocess.check_output([
    _get_ghostscript_binary(), '--version',
]).decode('utf-8')
if not re.match(r'9\.\d\d', GHOSTSCRIPT_VERSION):
    print(
        "Ghostscript must be version 9.X, have {}".format(GHOSTSCRIPT_VERSION),
    )
    sys.exit(1)


def pytest_report_header(config):
    return "Ghostscript version: {}".format(GHOSTSCRIPT_VERSION)
示例#7
0
# -*- coding:utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals

import re
import subprocess
import sys

from treepoem import _get_ghostscript_binary

GHOSTSCRIPT_VERSION = subprocess.check_output(
    [_get_ghostscript_binary(), '--version']).decode('utf-8')
if not re.match(r'9\.\d\d', GHOSTSCRIPT_VERSION):
    print(
        "Ghostscript must be version 9.X, have {}".format(GHOSTSCRIPT_VERSION))
    sys.exit(1)


def pytest_report_header(config):
    return "Ghostscript version: {}".format(GHOSTSCRIPT_VERSION)
示例#8
0
from __future__ import annotations

import re
import subprocess

from treepoem import _get_ghostscript_binary

GHOSTSCRIPT_VERSION = subprocess.check_output(
    [_get_ghostscript_binary(), "--version"]).decode("utf-8")
if not re.match(r"9\.\d\d", GHOSTSCRIPT_VERSION):
    print(f"Ghostscript must be version 9.X, have {GHOSTSCRIPT_VERSION}")
    raise SystemExit(1)


def pytest_report_header(config):
    return f"Ghostscript version: {GHOSTSCRIPT_VERSION}"
示例#9
0
import re
import subprocess
import sys

from treepoem import _get_ghostscript_binary

GHOSTSCRIPT_VERSION = subprocess.check_output(
    [_get_ghostscript_binary(), "--version"]
).decode("utf-8")
if not re.match(r"9\.\d\d", GHOSTSCRIPT_VERSION):
    print("Ghostscript must be version 9.X, have {}".format(GHOSTSCRIPT_VERSION))
    sys.exit(1)


def pytest_report_header(config):
    return "Ghostscript version: {}".format(GHOSTSCRIPT_VERSION)