1717
1818from .. import exc
1919from ..util import has_required_tmux_version , run_before_script
20- from ..exc import BeforeLoadScriptNotExists , BeforeLoadScriptFailed
20+ from ..exc import BeforeLoadScriptNotExists , BeforeLoadScriptError
2121
2222
2323from .helpers import TmuxTestCase , TestCase
@@ -72,10 +72,10 @@ def test_raise_BeforeLoadScriptNotExists_if_not_exists(self):
7272 with self .assertRaises (OSError ):
7373 run_before_script (script_file )
7474
75- def test_raise_BeforeLoadScriptFailed_if_retcode (self ):
75+ def test_raise_BeforeLoadScriptError_if_retcode (self ):
7676 script_file = os .path .join (fixtures_dir , 'script_failed.sh' )
7777
78- with self .assertRaises (BeforeLoadScriptFailed ):
78+ with self .assertRaises (BeforeLoadScriptError ):
7979 run_before_script (script_file )
8080
8181 def test_return_stdout_if_ok (self ):
@@ -84,24 +84,24 @@ def test_return_stdout_if_ok(self):
8484 run_before_script (script_file )
8585
8686
87- class BeforeLoadScriptFailedTestCase (TestCase ):
87+ class BeforeLoadScriptErrorTestCase (TestCase ):
8888
8989 def test_returncode (self ):
9090 script_file = os .path .join (fixtures_dir , 'script_failed.sh' )
9191
92- with self .assertRaisesRegexp (subprocess . CalledProcessError , "113" ):
92+ with self .assertRaisesRegexp (exc . BeforeLoadScriptError , "113" ):
9393 run_before_script (script_file )
9494
9595 def test_returns_stderr_messages (self ):
9696 script_file = os .path .join (fixtures_dir , 'script_failed.sh' )
9797
98- with self .assertRaisesRegexp (subprocess . CalledProcessError , "An error has occured " ):
98+ with self .assertRaisesRegexp (exc . BeforeLoadScriptError , "failed with returncode " ):
9999 run_before_script (script_file )
100100
101101
102102def suite ():
103103 suite = unittest .TestSuite ()
104- suite .addTest (unittest .makeSuite (BeforeLoadScriptFailedTestCase ))
104+ suite .addTest (unittest .makeSuite (BeforeLoadScriptErrorTestCase ))
105105 suite .addTest (unittest .makeSuite (RunBeforeScript ))
106106 suite .addTest (unittest .makeSuite (TmuxVersionTest ))
107107 return suite
0 commit comments