Skip to content

Commit 2d02331

Browse files
authored
Merge pull request JazzCore#91 from alanhamlett/fix-wkhtml2pdf-install-on-travis
fix wkhtml2pdf install on travis
2 parents 0923b63 + 6f1077d commit 2d02331

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

tests/pdfkit-tests.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
import unittest
77

88

9+
if sys.version_info[0] == 2 and sys.version_info[1] == 7:
10+
unittest.TestCase.assertRegex = unittest.TestCase.assertRegexpMatches
11+
12+
913
#Prepend ../ to PYTHONPATH so that we can import PDFKIT form there.
1014
TESTS_ROOT = os.path.abspath(os.path.dirname(__file__))
1115
sys.path.insert(0, os.path.realpath(os.path.join(TESTS_ROOT, '..')))
@@ -80,9 +84,9 @@ def test_options_parsing_with_tuple_no_dashes(self):
8084
def test_repeatable_options(self):
8185
roptions = {
8286
'--page-size': 'Letter',
83-
'cookies': [
87+
'cookies': [
8488
('test_cookie1','cookie_value1'),
85-
('test_cookie2','cookie_value2'),
89+
('test_cookie2','cookie_value2'),
8690
]
8791
}
8892

travis/before-script.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
#!/bin/sh
1+
#!/usr/bin/env sh
2+
3+
WKHTML2PDF_VERSION='0.12.4'
24

35
sudo apt-get install -y openssl build-essential xorg libssl-dev
4-
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
5-
tar -xJf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
6+
wget "https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTML2PDF_VERSION}/wkhtmltox-${WKHTML2PDF_VERSION}_linux-generic-amd64.tar.xz"
7+
tar -xJf "wkhtmltox-${WKHTML2PDF_VERSION}_linux-generic-amd64.tar.xz"
68
cd wkhtmltox
79
sudo chown root:root bin/wkhtmltopdf
810
sudo cp -r * /usr/

0 commit comments

Comments
 (0)