コード例 #1
0
    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')
コード例 #2
0
    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)
コード例 #3
0
    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')
コード例 #4
0
    def test_reports_failed(self):
        message = RunnerMessage(self.failed_message_sample, None)

        self.assertFalse(message.is_successful())
コード例 #5
0
    def test_reports_successful(self):
        message = RunnerMessage(self.success_message_sample, None)

        self.assertTrue(message.is_successful())
コード例 #6
0
    def test_inits_with_message_and_empty_extra_data(self):
        message = RunnerMessage(self.success_message_sample, None)

        self.assertIsNone(message.extra_data)