-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from b4stien/master
Make read of in-memory PDF work with 3.x - This closes issue #38 with code discussed there plus a regression test. - Also add Python version 3.5 to regression tests - Also add OSX filetypes to .gitignore
- Loading branch information
Showing
6 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ python: | |
- "2.7" | ||
- "3.3" | ||
- "3.4" | ||
- "3.5" | ||
- "nightly" | ||
# command to install dependencies | ||
before_install: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#! /usr/bin/env python | ||
import static_pdfs | ||
|
||
from pdfrw import PdfReader | ||
|
||
try: | ||
import unittest2 as unittest | ||
except ImportError: | ||
import unittest | ||
|
||
|
||
class TestPdfReaderInit(unittest.TestCase): | ||
|
||
def test_fname_binary_filelike(self): | ||
with open(static_pdfs.pdffiles[0][0], 'rb') as pdf_file: | ||
PdfReader(pdf_file) | ||
|
||
def test_fdata_binary(self): | ||
with open(static_pdfs.pdffiles[0][0], 'rb') as pdf_file: | ||
pdf_bytes = pdf_file.read() | ||
PdfReader(fdata=pdf_bytes) | ||
|
||
|
||
def main(): | ||
unittest.main() | ||
|
||
if __name__ == '__main__': | ||
main() |