#
# Copyright (c) 2016-2018 Intra2net AG <info@intra2net.com>
-""" call_helper_unittest.py: unit tests for call_helpers
-
-Should be run from python2 and python3!
-"""
+"""Unit tests for :py:mod:`pyi2ncommon.call_helpers`."""
from __future__ import absolute_import
class CallHelperTester(unittest.TestCase):
+ """Tester for module :py:mod:`pyi2ncommon.call_helpers`."""
def test_call_and_capture(self):
- """ tests call_and_capture with command ls -a / """
-
+ """Test call_and_capture with command ls -a /."""
cmd = ['ls', '-a', '/']
return_code, out_data, err_data = call_helpers.call_and_capture(cmd)
self.assertEqual(return_code, 0)
"Output is not of type str!")
def test_call_and_capture_bytes(self):
- """ tests call_and_capture with command ls -a / """
-
+ """Test call_and_capture with command ls -a /."""
cmd = ['ls', '-a', '/']
return_code, out_data, err_data = \
call_helpers.call_and_capture(cmd, universal_newlines=False)
self.assertFalse(is_unicode(out_data[0]), "Output is unicode!")
def test_call_and_capture_err(self):
- """ tests call_and_capture with command ls -a / """
-
+ """Test call_and_capture with invalid ls command."""
cmd = ['ls', '-e']
return_code, out_data, err_data = call_helpers.call_and_capture(cmd)
self.assertEqual(return_code, 2)