diff --git a/tests/test_command_list_split.py b/tests/test_command_list_split.py index 9ae5396..de8b9b2 100644 --- a/tests/test_command_list_split.py +++ b/tests/test_command_list_split.py @@ -22,8 +22,8 @@ import wexpect import unittest from . import PexpectTestCase -class SplitCommandLineTestCase(PexpectTestCase.PexpectTestCase): - def testSplitSizes(self): +class TestCaseSplitCommandLine(PexpectTestCase.PexpectTestCase): + def test_split_sizes(self): self.assertEqual(len(wexpect.split_command_line(r'')), 0) self.assertEqual(len(wexpect.split_command_line(r'one')), 1) self.assertEqual(len(wexpect.split_command_line(r'one two')), 2) @@ -34,7 +34,7 @@ class SplitCommandLineTestCase(PexpectTestCase.PexpectTestCase): self.assertEqual(len(wexpect.split_command_line(r'one\"one')), 1) self.assertEqual(len(wexpect.split_command_line(r"This^' is a^'^ test")), 3) - def testJoinArgs(self): + def test_join_args(self): cmd = 'foo bar "b a z"' cmd2 = wexpect.join_args(wexpect.split_command_line(cmd)) self.assertEqual(cmd2, cmd) @@ -46,4 +46,4 @@ class SplitCommandLineTestCase(PexpectTestCase.PexpectTestCase): if __name__ == '__main__': unittest.main() -suite = unittest.makeSuite(SplitCommandLineTestCase,'test') +suite = unittest.makeSuite(TestCaseSplitCommandLine,'test') diff --git a/tests/test_interact.py b/tests/test_interact.py index 953c733..fc7c16d 100644 --- a/tests/test_interact.py +++ b/tests/test_interact.py @@ -33,6 +33,8 @@ import unittest from . import PexpectTestCase class InteractTestCase(PexpectTestCase.PexpectTestCase): + + @unittest.skipIf(not hasattr(wexpect.spawn, 'interact'), "spawn does not support runtime interact switching.") def test_interact(self): # Path of cmd executable: cmd_exe = 'cmd' @@ -54,7 +56,8 @@ class InteractTestCase(PexpectTestCase.PexpectTestCase): p.stop_interact() self.assertEqual('hello', p.before.splitlines()[1]) - + + @unittest.skipIf(not hasattr(wexpect.spawn, 'interact'), "spawn does not support runtime interact switching.") def test_interact_dead(self): # Path of cmd executable: echo = 'echo hello' diff --git a/tests/test_misc.py b/tests/test_misc.py index ea94c12..1ad981e 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -198,10 +198,11 @@ class TestCaseMisc(PexpectTestCase.PexpectTestCase): def test_isalive(self): " check isalive() before and after EOF. (True, False) " child = wexpect.spawn('cat') - assert child.isalive() is True + self.assertTrue(child.isalive()) child.sendeof() child.expect(wexpect.EOF) assert child.isalive() is False + self.assertFalse(child.isalive()) def test_bad_type_in_expect(self): " expect() does not accept dictionary arguments. "