Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

Commit

Permalink
Set up tests module.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Ferrier committed Dec 17, 2014
1 parent 8d01c76 commit 1601e0f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ builddeb:
fakeroot dpkg-deb --build $(TEMPDIR) .

unittest:
./email2pdf_unittest
python3 -m unittest discover

clean:
rm -f *.deb
Expand Down
Empty file added tests/__init__.py
Empty file.
7 changes: 5 additions & 2 deletions email2pdf_unittest → tests/test_email2pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ def setUpModule():
examineDir = tempfile.mkdtemp(dir=examineDir)
print("Output examination directory: " + examineDir)

print("Checking if online... ", end="")
sys.stdout.flush()
ONLINE_URL = "https://raw.githubusercontent.com/andrewferrier/email2pdf/master"
try:
requests.get(ONLINE_URL)
requests.get(ONLINE_URL, timeout=1)
isOnline = True
print("Yes.")
except:
isOnline = False
print("No.")


def touch(fname):
Expand Down Expand Up @@ -112,7 +116,6 @@ def invokeEmail2PDF(self, inputFile=False, outputDirectory=None, sysErrExpected=
if outputFile:
options.extend(['-o', outputFile])

options.extend(sys.argv[1:])
options.extend(extraParams)

self.timeInvoked = datetime.now()
Expand Down

0 comments on commit 1601e0f

Please sign in to comment.