def test_gets_data_from_data_dictionary_by_dot_notation(self): message = RunnerMessage(self.success_message_sample, {'foo': 'bar'}) data = message.foo self.assertEqual(data, 'bar')
def test_gets_extra_data_with_helper_with_no_data(self): message = RunnerMessage(self.success_message_sample, None) data = message.get_extra_data() self.assertEqual(data, None)
def test_gets_extra_data_with_helper_method(self): message = RunnerMessage(self.success_message_sample, 'test') data = message.get_extra_data() self.assertEqual(data, 'test')
def test_reports_failed(self): message = RunnerMessage(self.failed_message_sample, None) self.assertFalse(message.is_successful())
def test_reports_successful(self): message = RunnerMessage(self.success_message_sample, None) self.assertTrue(message.is_successful())
def test_inits_with_message_and_empty_extra_data(self): message = RunnerMessage(self.success_message_sample, None) self.assertIsNone(message.extra_data)