Unit tests buildozer --help command, refs #813

This test should fail due to #813. Next commit will fix it.
This commit is contained in:
Andre Miras 2019-02-08 18:51:07 +01:00
parent c88f048739
commit 0d22e60e2e
2 changed files with 13 additions and 0 deletions

View file

@ -1,7 +1,9 @@
import os
import mock
import unittest
import buildozer as buildozer_module
from buildozer import Buildozer
from six import StringIO
class TestBuildozer(unittest.TestCase):
@ -24,3 +26,13 @@ class TestBuildozer(unittest.TestCase):
'default.spec')
buildozer = Buildozer(filename=specfilepath)
self.assertTrue(os.path.exists(buildozer.specfilename))
def test_buildozer_help(self):
"""
Makes sure the help gets display with no error, refs:
https://github.com/kivy/buildozer/issues/813
"""
buildozer = Buildozer()
with mock.patch('sys.stdout', new_callable=StringIO) as mock_stdout:
buildozer.usage()
self.assertIn('Usage:', mock_stdout.getvalue())

View file

@ -2,6 +2,7 @@
envlist = pep8,py27,py36
[testenv]
deps = mock
commands =
python -m unittest discover --top-level-directory=. --start-directory=tests/