diff --git a/functional_tests/test_init.py b/functional_tests/test_init.py new file mode 100644 index 0000000000000000000000000000000000000000..49f6c0f02299a8c1c60fda2b055fc07213a1ba3a --- /dev/null +++ b/functional_tests/test_init.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2018 Branko Majic +# +# This file is part of Gimmecert. +# +# Gimmecert is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) any +# later version. +# +# Gimmecert is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# Gimmecert. If not, see . +# + + +from .base import run_command + + +def test_init_command_available_with_help(): + # John has decided it is time to try out the tool. He starts off + # by running the short usage help. + stdout, stderr, returncode = run_command("gimmecert", "-h") + + # Looking at output, John notices the init command. + assert returncode == 0 + assert stderr == "" + assert 'init' in stdout + + # John decides to look at a more detailed description of this + # command before proceeding. + stdout, stderr, returncode = run_command("gimmecert", "init", "-h") + + # John notices that this command has some useful usage + # instructions, which allows him to study the available arguments. + assert returncode == 0 + assert stderr == "" + assert stdout.startswith("usage: gimmecert init")