You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.
@rdegges Thanks for writing this program. I'm would like to use it as a basis for developing a CLI app. I noticed that the unit tests are not properly accounting for python3 strings. I'm not certain how to fix this as I have not worked with subprocess.
(venv) dockerx@de8efbd3a5e2:~/PycharmProjects/skele-cli$ python3 --version
Python 3.4.3
(venv) dockerx@de8efbd3a5e2:~/PycharmProjects/skele-cli$ python3 setup.py test
running test
================================================================== test session starts ===================================================================
platform linux -- Python 3.4.3, pytest-3.0.7, py-1.4.33, pluggy-0.4.0
rootdir: /home/dockerx/PycharmProjects/skele-cli, inifile:
plugins: cov-2.4.0
collected 4 items
tests/test_cli.py FF
tests/commands/test_hello.py FF
----------- coverage: platform linux, python 3.4.3-final-0 -----------
Name Stmts Miss Cover Missing
----------------------------------------------------------
skele/__init__.py 1 0 100%
skele/cli.py 13 0 100%
skele/commands/__init__.py 1 0 100%
skele/commands/base.py 7 1 86% 13
skele/commands/hello.py 6 0 100%
----------------------------------------------------------
TOTAL 28 1 96%
======================================================================== FAILURES ========================================================================
________________________________________________________ TestHelp.test_returns_usage_information _________________________________________________________
self = <test_cli.TestHelp testMethod=test_returns_usage_information>
def test_returns_usage_information(self):
output = popen(['skele', '-h'], stdout=PIPE).communicate()[0]
> self.assertTrue('Usage:' in output)
E TypeError: 'str' does not support the buffer interface
tests/test_cli.py:13: TypeError
______________________________________________________ TestVersion.test_returns_version_information ______________________________________________________
self = <test_cli.TestVersion testMethod=test_returns_version_information>
def test_returns_version_information(self):
output = popen(['skele', '--version'], stdout=PIPE).communicate()[0]
> self.assertEqual(output.strip(), VERSION)
E AssertionError: b'1.0.0' != '1.0.0'
tests/test_cli.py:22: AssertionError
___________________________________________________________ TestHello.test_returns_hello_world ___________________________________________________________
self = <test_hello.TestHello testMethod=test_returns_hello_world>
def test_returns_hello_world(self):
output = popen(['skele', 'hello'], stdout=PIPE).communicate()[0]
> self.assertTrue('Hello, world!' in output)
E TypeError: 'str' does not support the buffer interface
tests/commands/test_hello.py:16: TypeError
_________________________________________________________ TestHello.test_returns_multiple_lines __________________________________________________________
self = <test_hello.TestHello testMethod=test_returns_multiple_lines>
def test_returns_multiple_lines(self):
output = popen(['skele', 'hello'], stdout=PIPE).communicate()[0]
> lines = output.split('\n')
E TypeError: 'str' does not support the buffer interface
tests/commands/test_hello.py:11: TypeError
================================================================ 4 failed in 2.50 seconds ================================================================
(venv) dockerx@de8efbd3a5e2:~/PycharmProjects/skele-cli$
The text was updated successfully, but these errors were encountered:
@jeffbrl I have been working through this and have pinpointed the error in my fork of the project. I was able to fix the errors you're encountering in TestHelp.test_returns_usage_information and TestHelp.test_returns_version_information by encoding the strings to utf-8.
@rdegges Thanks for writing this program. I'm would like to use it as a basis for developing a CLI app. I noticed that the unit tests are not properly accounting for python3 strings. I'm not certain how to fix this as I have not worked with
subprocess
.The text was updated successfully, but these errors were encountered: