コード例 #1
0
    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)
コード例 #2
0
    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)
コード例 #3
0
 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, [])
コード例 #4
0
 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, [])