1
0
Fork 1
mirror of https://github.com/andrewferrier/email2pdf.git synced 2025-03-15 04:34:50 +00:00

Set up tests module.

This commit is contained in:
Andrew Ferrier 2014-12-17 18:46:32 +00:00
parent 8d01c76215
commit 1601e0fb87
3 changed files with 6 additions and 3 deletions

View file

@ -13,7 +13,7 @@ builddeb:
fakeroot dpkg-deb --build $(TEMPDIR) .
unittest:
./email2pdf_unittest
python3 -m unittest discover
clean:
rm -f *.deb

0
tests/__init__.py Normal file
View file

View file

@ -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):
@ -112,7 +116,6 @@ class BaseTestClasses:
if outputFile:
options.extend(['-o', outputFile])
options.extend(sys.argv[1:])
options.extend(extraParams)
self.timeInvoked = datetime.now()