Fixed wonky test initialisation (ref #31).
1 parent daf6553 commit 53fd7103fabe319a66f9b10361c67d44d4057cad
Nigel Stanger authored on 18 Sep 2018
Showing 1 changed file
View
17
test_shell_command.py
class TestShellCommand(unittest.TestCase):
"""Test the ShellCommand class.
"""
 
# Local ShellCommand.
command = None
 
def setUp(self):
"""Test initialisation.
"""Initialisation. Make sure the input and output options are
explicitly set to [] otherwise they hang around from previous
tests.
"""
self.command = ShellCommand()
self.command = ShellCommand(input_options=[], output_options=[])
 
def tearDown(self):
"""Test cleanup.
"""Cleanup.
"""
del(self.command)
self.command = None
 
def test_shellquote(self):
"""Test static method ShellCommand.shellquote().
"""
# None => None
self.assertIsNone(ShellCommand.shellquote(None))
# empty => empty
self.assertEqual(ShellCommand.shellquote(""), "")
# foobar => foobar
self.assertEqual(ShellCommand.shellquote("foobar"), "foobar")