def test_check_error_raises_RuntimeError_on_timeout(self): fn = lambda: UpstartApplicationLauncher._check_status_error( UpstartApplicationLauncher.Timeout) self.assertThat( fn, raises( RuntimeError( "Timed out while waiting for application to launch")))
def test_check_error_does_nothing_on_None(self): UpstartApplicationLauncher._check_status_error(None)
def test_check_error_raises_RuntimeError_with_extra_message(self): fn = lambda: UpstartApplicationLauncher._check_status_error( UpstartApplicationLauncher.Failed, "extra message") self.assertThat( fn, raises(RuntimeError("Application Launch Failed: extra message")))
def test_check_error_raises_RuntimeError_on_failure(self): fn = lambda: UpstartApplicationLauncher._check_status_error( UpstartApplicationLauncher.Failed) self.assertThat(fn, raises(RuntimeError("Application Launch Failed")))