示例#1
0
    def test_list_messages(self):
        """Test list_messages() can list known messages."""

        messages = list_messages()
        self.assertEqual(messages, [
            self.TestMessageA, self.TestMessageB, self.TestMessageC,
            self.TestMessageD
        ])
示例#2
0
文件: test_message.py 项目: acfr/mcl
    def test_list_messages(self):
        """Test list_messages() can list known messages."""

        messages = list_messages()
        self.assertEqual(messages,
                         [self.TestMessageA,
                          self.TestMessageB,
                          self.TestMessageC,
                          self.TestMessageD])
示例#3
0
文件: test_message.py 项目: acfr/mcl
    def test_list_messages_include(self):
        """Test list_messages() can include only specified messages."""

        # Test string input.
        messages = list_messages(include='TestMessageA')
        self.assertEqual(messages, [self.TestMessageA])

        # Test list input.
        messages = list_messages(include=['TestMessageA', 'TestMessageB'])
        self.assertEqual(messages, [self.TestMessageA, self.TestMessageB])

        # Ensure exception is raised on non-string input.
        with self.assertRaises(TypeError):
            list_messages(include=False)
        with self.assertRaises(TypeError):
            list_messages(include=['TestMessageA', False])
示例#4
0
    def test_list_messages_include(self):
        """Test list_messages() can include only specified messages."""

        # Test string input.
        messages = list_messages(include='TestMessageA')
        self.assertEqual(messages, [self.TestMessageA])

        # Test list input.
        messages = list_messages(include=['TestMessageA', 'TestMessageB'])
        self.assertEqual(messages, [self.TestMessageA, self.TestMessageB])

        # Ensure exception is raised on non-string input.
        with self.assertRaises(TypeError):
            list_messages(include=False)
        with self.assertRaises(TypeError):
            list_messages(include=['TestMessageA', False])
示例#5
0
文件: test_message.py 项目: acfr/mcl
    def test_list_messages_include_exclude(self):
        """Test list_messages() can include and excluded specified messages."""

        messages = list_messages(include=['TestMessageA', 'TestMessageB'],
                                 exclude='TestMessageA')
        self.assertEqual(messages, [self.TestMessageB])
示例#6
0
    def test_list_messages_include_exclude(self):
        """Test list_messages() can include and excluded specified messages."""

        messages = list_messages(include=['TestMessageA', 'TestMessageB'],
                                 exclude='TestMessageA')
        self.assertEqual(messages, [self.TestMessageB])