def test_get_messages(self): """should return a list of Message objects messages given should have been instantiated as the given Message type """ count = 3 receiver = MessageReceiver(MockService(count), Message) messages = receiver.get_messages() self.assertEqual(len(messages), count) self.assertIsInstance(messages[0], Message)
def test_get_messages_no_messages(self): """should return an empty list if there are no messages""" receiver = MessageReceiver(MockService(0), Message) messages = receiver.get_messages() self.assertEqual(messages, [])