@@ -587,7 +587,7 @@ class BeforeLoadScript(TmuxTestCase):
587587 - pane
588588 """
589589
590- def test_throw_error_if_retcode_false (self ):
590+ def test_throw_error_if_retcode_error (self ):
591591
592592 sconfig = kaptan .Kaptan (handler = 'yaml' )
593593 yaml = self .config_script_fails .format (
@@ -602,7 +602,7 @@ def test_throw_error_if_retcode_false(self):
602602 with self .temp_session () as sess :
603603 session_name = sess .get ('session_name' )
604604
605- with self .assertRaises (subprocess .CalledProcessError ):
605+ with self .assertRaises (( exc . BeforeLoadScriptFailed , subprocess .CalledProcessError ) ):
606606 builder .build (session = sess )
607607
608608 result = self .server .has_session (session_name )
@@ -628,7 +628,7 @@ def test_throw_error_if_file_not_exists(self):
628628 temp_session_exists = self .server .has_session (sess .get ('session_name' ))
629629 self .assertTrue (temp_session_exists )
630630 with self .assertRaisesRegexp (
631- (BeforeLoadScriptNotExists , OSError ),
631+ (exc . BeforeLoadScriptNotExists , OSError ),
632632 'No such file or directory'
633633 ):
634634 builder .build (session = sess )
@@ -654,40 +654,9 @@ def test_true_if_test_passes(self):
654654 builder .build (session = self .session )
655655
656656
657- from ..workspacebuilder import run_before_script , BeforeLoadScriptNotExists , \
658- BeforeLoadScriptFailed
659-
660-
661- class RunBeforeScript (TestCase ):
662-
663- def test_raise_BeforeLoadScriptNotExists_if_not_exists (self ):
664- script_file = os .path .join (fixtures_dir , 'script_noexists.sh' )
665-
666- with self .assertRaises (BeforeLoadScriptNotExists ):
667- run_before_script (script_file )
668-
669- with self .assertRaises (OSError ):
670- run_before_script (script_file )
671-
672- def test_raise_BeforeLoadScriptFailed_if_retcode (self ):
673- script_file = os .path .join (fixtures_dir , 'script_failed.sh' )
674-
675- with self .assertRaises (BeforeLoadScriptFailed ):
676- run_before_script (script_file )
677-
678- with self .assertRaises (subprocess .CalledProcessError ):
679- run_before_script (script_file )
680-
681- def test_return_stdout_if_exits_zero (self ):
682- script_file = os .path .join (fixtures_dir , 'script_complete.sh' )
683-
684- run_before_script (script_file )
685-
686-
687657def suite ():
688658 suite = unittest .TestSuite ()
689659 suite .addTest (unittest .makeSuite (BeforeLoadScript ))
690- suite .addTest (unittest .makeSuite (RunBeforeScript ))
691660 suite .addTest (unittest .makeSuite (BlankPaneTest ))
692661 suite .addTest (unittest .makeSuite (FocusAndPaneIndexTest ))
693662 suite .addTest (unittest .makeSuite (PaneOrderingTest ))
0 commit comments