From 6398befe1417be97b4b53ea5b53134f3ed09faeb Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 4 Apr 2018 00:22:00 +0200 Subject: [PATCH] Add a first test for the CLI --- tests/test_climat2.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/test_climat2.py diff --git a/tests/test_climat2.py b/tests/test_climat2.py new file mode 100644 index 0000000..a0bcafc --- /dev/null +++ b/tests/test_climat2.py @@ -0,0 +1,10 @@ +import unittest +import subprocess +import os + + +class TestHelp(unittest.TestCase): + def test_help(self): + proc = subprocess.Popen(['./main.py', '--help'], stdout=subprocess.PIPE) + stdout, _ = proc.communicate() + self.assertIn(b'usage: main.py [-h] [-c] [-l] [-s] [files [files ...]]', stdout)