def assertFailedObserverSetsExtraMessage(self, fail_type, expected_msg):
     """Assert that the on_failed observer must set the expected message
     for a particular failure_type."""
     expected_app_id = self.getUniqueString()
     state = {'expected_app_id': expected_app_id, 'loop': Mock()}
     UpstartApplicationLauncher._on_failed(expected_app_id, fail_type,
                                           state)
     self.assertEqual(expected_msg, state['message'])
    def test_on_failed_only_sets_status_on_correct_app_id(self):
        state = {
            'expected_app_id': 'gedit',
        }

        UpstartApplicationLauncher._on_failed('some_game', None, state)

        self.assertThat(state, Not(Contains('status')))