tests: test main()

This commit is contained in:
Dylan Araps 2017-07-23 23:12:57 +10:00
parent 9b695da635
commit 84b134a50d
2 changed files with 7 additions and 2 deletions

View File

@ -6,8 +6,13 @@ from pywal import __main__
class TestMain(unittest.TestCase): class TestMain(unittest.TestCase):
"""Test the gen_colors functions.""" """Test the gen_colors functions."""
def test_main(self):
"""> Test main function."""
with self.assertRaises(SystemExit):
__main__.main()
def test_no_args(self): def test_no_args(self):
"""> Generate a colorscheme and fail.""" """> Test no args."""
with self.assertRaises(SystemExit): with self.assertRaises(SystemExit):
args = __main__.get_args([""]) args = __main__.get_args([""])
__main__.process_args(args) __main__.process_args(args)

View File

@ -57,7 +57,7 @@ class TestUtil(unittest.TestCase):
self.assertTrue(result) self.assertTrue(result)
def test_create_dir(self): def test_create_dir(self):
"""> Create a directoru.""" """> Create a directory."""
tmp_dir = pathlib.Path("/tmp/test_dir") tmp_dir = pathlib.Path("/tmp/test_dir")
util.create_dir(tmp_dir) util.create_dir(tmp_dir)
result = tmp_dir.is_dir() result = tmp_dir.is_dir()