From 8f013a7bc72f6f1aa7ed2d4e0d88ef9a77055081 Mon Sep 17 00:00:00 2001 From: codl Date: Mon, 13 Aug 2018 14:41:28 +0200 Subject: [PATCH] add test to check that doit runs successfully --- test/conftest.py | 8 ++++++++ test/test_doit.py | 9 +++++++++ 2 files changed, 17 insertions(+) create mode 100644 test/conftest.py create mode 100644 test/test_doit.py diff --git a/test/conftest.py b/test/conftest.py new file mode 100644 index 0000000..3c7960c --- /dev/null +++ b/test/conftest.py @@ -0,0 +1,8 @@ +import sys +from pathlib import Path + +PROJDIR = str(Path(__file__).parent.parent) +if PROJDIR not in sys.path: + print(PROJDIR) + sys.path.append(PROJDIR) + diff --git a/test/test_doit.py b/test/test_doit.py new file mode 100644 index 0000000..160775d --- /dev/null +++ b/test/test_doit.py @@ -0,0 +1,9 @@ +import dodo +import doit +from unittest.mock import patch + + +def test_doit(): + with patch('sys.exit') as exit: + doit.run(dodo) + exit.assert_called_with(0)