class MessageReceiverTests(TestCase): def setUp(self): self.receiver = MessageReceiver() self.sender = MessageReceiver() def test_tell(self): m = Message('buy more eggs', self.sender) self.receiver.tell(m) self.assertEqual(self.receiver.inbox, [m]) def test_messages_in_order_received(self): m1 = Message('buy more eggs', self.sender) m2 = Message('buy a magazine', self.sender) self.receiver.tell(m1) self.receiver.tell(m2) self.assertEqual(self.receiver.inbox[m1, m2])
class MessageReceiverTests(TestCase): def setUp(self): self.receiver = MessageReceiver() self.sender = MessageReceiver() def test_tell(self): m = Message('buy more eggs', self.sender) self.receiver.tell(m) self.assertEqual(self.receiver.inbox, [m]) def test_messages_in_order_received(self): m1 = Message('buy more eggs', self.sender) m2 = Message('buy a magazine', self.sender) self.receiver.tell(m1) self.receiver.tell(m2) self.assertEqual(self.receiver.inbox [m1, m2])
def setUp(self): self.receiver = MessageReceiver() self.sender = MessageReceiver()