コード例 #1
0
 def test_is_number(self):
     """Test that numbers are correctly identified"""
     # Test all defined numbers. Should be True
     for i in self.numbers:
         self.assertTrue(validate.is_number(i))
     # Test all defined numbers to be vowels or consonants. Should
     # be False
     for i in self.vowels + self.consonants:
         self.assertFalse(validate.is_number(i))
コード例 #2
0
 def test_is_number(self):
     """Test that numbers are correctly identified"""
     # Test all defined numbers. Should be True
     for i in self.numbers:
         self.assertTrue(validate.is_number(i))
     # Test all defined numbers to be vowels or consonants. Should
     # be False
     for i in self.vowels + self.consonants:
         self.assertFalse(validate.is_number(i))
コード例 #3
0
    def test_is_punctuation(self):
        """Test that punctuations are correctly identified

        Anything that is neither a number, nor vowel nor consonant is
        identified as a punctuation.

        """
        for i in '`~!@#$%^&*()-_=+\\|[{}]\'",<.>/?':
            self.assertTrue(validate.is_punctuation(i))
            self.assertFalse(validate.is_vowel(i))
            self.assertFalse(validate.is_consonant(i))
            self.assertFalse(validate.is_number(i))
コード例 #4
0
    def test_is_punctuation(self):
        """Test that punctuations are correctly identified

        Anything that is neither a number, nor vowel nor consonant is
        identified as a punctuation.

        """
        for i in '`~!@#$%^&*()-_=+\\|[{}]\'",<.>/?':
            self.assertTrue(validate.is_punctuation(i))
            self.assertFalse(validate.is_vowel(i))
            self.assertFalse(validate.is_consonant(i))
            self.assertFalse(validate.is_number(i))