diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-04-15 11:05:19 +0100 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-04-15 11:05:19 +0100 |
| commit | e0aba92623d9961602d37a5e3f6ce01403e3598a (patch) | |
| tree | 0a06bd64c226238bd14f80b19df2a8c67eafcc67 /tests | |
| parent | remove unnecessary logging (diff) | |
| download | paper2remarkable-e0aba92623d9961602d37a5e3f6ce01403e3598a.tar.gz paper2remarkable-e0aba92623d9961602d37a5e3f6ce01403e3598a.zip | |
Properly check for the installed pdf tool
This fixes #42.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_utils.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py new file mode 100644 index 0000000..4c122e0 --- /dev/null +++ b/tests/test_utils.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import unittest + +from paper2remarkable.exceptions import NoPDFToolError +from paper2remarkable.utils import check_pdftool + + +class TestUtils(unittest.TestCase): + def test_check_pdftool(self): + # Needs a system with both pdftk and qpdf available + self.assertEqual(check_pdftool("pdftk", "qpdf"), "pdftk") + self.assertEqual(check_pdftool("pdftk_xyz", "qpdf"), "qpdf") + self.assertEqual(check_pdftool("pdftk", "qpdf_xyz"), "pdftk") + with self.assertRaises(NoPDFToolError): + check_pdftool("pdftk_xyz", "qpdf_xyz") + + +if __name__ == "__main__": + unittest.main() |
