File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424
2525 - name : Install Google Chrome
2626 run : |
27- choco install googlechrome --no-progress -y
27+ choco install googlechrome --no-progress -y --ignore-checksums
2828 shell : powershell
2929
3030 - name : Check Chrome Version
Original file line number Diff line number Diff line change 2323from webdriver_manager .core .http import HttpClient
2424from webdriver_manager .core .os_manager import OperationSystemManager
2525
26- __version__ = "0.0.4 "
26+ __version__ = "0.0.5 "
2727
2828DEFAULT_CACHE_DIR = os .path .join (Path .home (), ".html2print" , "chromedriver" )
2929
@@ -316,7 +316,7 @@ def exit_handler():
316316 assert len (paths ) % 2 == 0 , (
317317 f"Expecting an even number of input/output path arguments: { paths } ."
318318 )
319- for current_pair_idx in range (0 , 2 , len (paths )):
319+ for current_pair_idx in range (0 , len (paths ), 2 ):
320320 path_to_input_html = paths [current_pair_idx ]
321321 path_to_output_pdf = paths [current_pair_idx + 1 ]
322322
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ RUN: %html2pdf print --cache-dir %S/Output/cache %S/index.html %S/Output/index.p
22RUN: %check_exists --file "%S/Output/index.pdf"
33RUN: python %S/test.py
44
5- CHECK-RUN1: html2pdf : ChromeDriver does not exist in the local cache:
5+ CHECK-RUN1: html2print : ChromeDriver does not exist in the local cache:
66
77RUN: %html2pdf print --cache-dir %S/Output/cache %S/index.html %S/Output/index.pdf | filecheck %s --dump-input=fail --check-prefix CHECK-RUN2
88RUN: %check_exists --file "%S/Output/index.pdf"
99RUN: python %S/test.py
1010
11- CHECK-RUN2: html2pdf : ChromeDriver exists in the local cache:
11+ CHECK-RUN2: html2print : ChromeDriver exists in the local cache:
Original file line number Diff line number Diff line change 1+ <!doctype html>
2+ < html lang ="">
3+
4+ < head >
5+ < meta charset ="utf-8 ">
6+ < title > Test page</ title >
7+ < script src ="../../../submodules/html2pdf/dist/bundle.js "> </ script >
8+ < link rel ="stylesheet " href ="../../../submodules/html2pdf/test/shared/css/main.css ">
9+ </ head >
10+
11+ < body >
12+ < p > Hello world!</ p >
13+ </ body >
14+
15+ </ html >
Original file line number Diff line number Diff line change 1+ <!doctype html>
2+ < html lang ="">
3+
4+ < head >
5+ < meta charset ="utf-8 ">
6+ < title > Test page</ title >
7+ < script src ="../../../submodules/html2pdf/dist/bundle.js "> </ script >
8+ < link rel ="stylesheet " href ="../../../submodules/html2pdf/test/shared/css/main.css ">
9+ </ head >
10+
11+ < body >
12+ < p > Hello world!</ p >
13+ </ body >
14+
15+ </ html >
Original file line number Diff line number Diff line change 1+ RUN: %html2pdf print %S/index1.html %S/Output/index1.pdf %S/index2.html %S/Output/index2.pdf
2+
3+ RUN: %check_exists --file "%S/Output/index1.pdf"
4+ RUN: %check_exists --file "%S/Output/index2.pdf"
5+
6+ RUN: python %S/test.py
Original file line number Diff line number Diff line change 1+ from pypdf import PdfReader
2+
3+ reader = PdfReader ("Output/index1.pdf" )
4+ assert len (reader .pages ) == 1
5+ assert reader .pages [0 ].extract_text () == "Hello world!"
6+
7+ reader = PdfReader ("Output/index2.pdf" )
8+ assert len (reader .pages ) == 1
9+ assert reader .pages [0 ].extract_text () == "Hello world!"
You can’t perform that action at this time.
0 commit comments