Merge pull request #821 from AndreMiras/feature/ticket813_buildozer_help_crashes
Unit tests buildozer --help command, refs #813
This commit is contained in:
commit
197be74037
3 changed files with 14 additions and 0 deletions
|
@ -1225,4 +1225,5 @@ class TargetAndroid(Target):
|
|||
|
||||
|
||||
def get_target(buildozer):
|
||||
buildozer.targetname = "android"
|
||||
return TargetAndroid(buildozer)
|
||||
|
|
|
@ -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())
|
||||
|
|
1
tox.ini
1
tox.ini
|
@ -2,6 +2,7 @@
|
|||
envlist = pep8,py27,py36
|
||||
|
||||
[testenv]
|
||||
deps = mock
|
||||
commands =
|
||||
python -m unittest discover --top-level-directory=. --start-directory=tests/
|
||||
|
||||
|
|
Loading…
Reference in a new issue