From d5dfdc8193c4c9befd97ae8e499a08c0bd113267 Mon Sep 17 00:00:00 2001 From: Aaron Eikenberry Date: Thu, 3 Aug 2017 00:01:21 -0500 Subject: [PATCH 1/3] adds test for -e --- tests/test_main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_main.py b/tests/test_main.py index 4dbe580..6cf518f 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1,7 +1,8 @@ """Test __main__ functions.""" import unittest +from unittest.mock import MagicMock -from pywal import __main__ +from pywal import __main__, reload from pywal.settings import CACHE_DIR @@ -14,6 +15,12 @@ class TestMain(unittest.TestCase): __main__.process_args(args) self.assertFalse((CACHE_DIR / "schemes").is_dir()) + def test_args_e(self): + """> Test arg parsing (-e)""" + reload.env = MagicMock() + args = __main__.get_args(["-e"]) + __main__.process_args(args) + reload.env.assert_not_called() if __name__ == "__main__": unittest.main() From 67831428f16614f018f54746fa0fd1654089fb05 Mon Sep 17 00:00:00 2001 From: Aaron Eikenberry Date: Thu, 3 Aug 2017 00:09:03 -0500 Subject: [PATCH 2/3] fixes lint error --- tests/test_main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_main.py b/tests/test_main.py index 6cf518f..d3dbcac 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -20,7 +20,8 @@ class TestMain(unittest.TestCase): reload.env = MagicMock() args = __main__.get_args(["-e"]) __main__.process_args(args) - reload.env.assert_not_called() + self.assertFalse(reload.env.called) + if __name__ == "__main__": unittest.main() From f2f0769d70930533c9fffaf7bbb9adba477ef466 Mon Sep 17 00:00:00 2001 From: Aaron Eikenberry Date: Thu, 3 Aug 2017 00:10:42 -0500 Subject: [PATCH 3/3] adds import to it's own line --- tests/test_main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_main.py b/tests/test_main.py index d3dbcac..9262c8f 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -2,7 +2,8 @@ import unittest from unittest.mock import MagicMock -from pywal import __main__, reload +from pywal import __main__ +from pywal import reload from pywal.settings import CACHE_DIR