diff --git a/Makefile b/Makefile index 82ab1ca..9c003bb 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ builddeb: fakeroot dpkg-deb --build $(TEMPDIR) . unittest: - ./email2pdf_unittest + python3 -m unittest discover clean: rm -f *.deb diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/email2pdf_unittest b/tests/test_email2pdf.py similarity index 99% rename from email2pdf_unittest rename to tests/test_email2pdf.py index cb0417d..9529a73 100755 --- a/email2pdf_unittest +++ b/tests/test_email2pdf.py @@ -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 @@ 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()