@@ -105,6 +105,9 @@ def test_get_template_decode(self):
105105
106106
107107class TestExternalCommand (unittest .TestCase ):
108+ NO_STDERR_MSG = (
109+ 'external command has exited with error code 1 -- No stderr output'
110+ )
108111
109112 @utilities .async_test
110113 async def test_no_spawn_no_stdin_success (self ):
@@ -126,9 +129,7 @@ async def test_no_spawn_no_stdin_attached(self):
126129 ui = utilities .make_ui ()
127130 cmd = g_commands .ExternalCommand ('test -p /dev/stdin' , refocus = False )
128131 await cmd .apply (ui )
129- ui .notify .assert_called_once_with (
130- 'editor has exited with error code 1 -- No stderr output' ,
131- priority = 'error' )
132+ ui .notify .assert_called_once_with (self .NO_STDERR_MSG , priority = 'error' )
132133
133134 @utilities .async_test
134135 async def test_no_spawn_stdin_attached (self ):
@@ -143,9 +144,7 @@ async def test_no_spawn_failure(self):
143144 ui = utilities .make_ui ()
144145 cmd = g_commands .ExternalCommand ('false' , refocus = False )
145146 await cmd .apply (ui )
146- ui .notify .assert_called_once_with (
147- 'editor has exited with error code 1 -- No stderr output' ,
148- priority = 'error' )
147+ ui .notify .assert_called_once_with (self .NO_STDERR_MSG , priority = 'error' )
149148
150149 @utilities .async_test
151150 @mock .patch (
@@ -177,9 +176,7 @@ async def test_spawn_failure(self):
177176 ui = utilities .make_ui ()
178177 cmd = g_commands .ExternalCommand ('false' , refocus = False , spawn = True )
179178 await cmd .apply (ui )
180- ui .notify .assert_called_once_with (
181- 'editor has exited with error code 1 -- No stderr output' ,
182- priority = 'error' )
179+ ui .notify .assert_called_once_with (self .NO_STDERR_MSG , priority = 'error' )
183180
184181
185182class TestCallCommand (unittest .TestCase ):
0 commit comments