コード例 #1
0
 def test_full_name_and_whitespace_included(self):
     self.assertTrue(
         validator.name_validator("Lakshay Mohanlal Badlani ",
                                  self.name_regex_for_testing))
コード例 #2
0
 def test_middle_name_included(self):
     self.assertTrue(
         validator.name_validator("Lakshay Mohanlal Badlani",
                                  self.name_regex_for_testing))
コード例 #3
0
 def test_only_middle_name(self):
     self.assertFalse(
         validator.name_validator("Lakshay Mohanlal Mohanlal Badlani",
                                  self.name_regex_for_testing))
コード例 #4
0
 def test_name_too_short(self):
     self.assertFalse(
         validator.name_validator("L", self.name_regex_for_testing))
コード例 #5
0
 def test_name_too_long(self):
     self.assertFalse(
         validator.name_validator(
             "Lakshay lakshay lakshay lakshay lakshay lakshay lakshay lakshay",
             self.name_regex_for_testing))
コード例 #6
0
 def test_special_characters_in_name(self):
     self.assertFalse(
         validator.name_validator("La^%Kshay", self.name_regex_for_testing))
コード例 #7
0
 def test_first_name_and_whitespace_in_name(self):
     self.assertTrue(
         validator.name_validator("Lakshay ", self.name_regex_for_testing))
コード例 #8
0
 def test_only_white_space_in_name(self):
     self.assertFalse(
         validator.name_validator("      ", self.name_regex_for_testing))
コード例 #9
0
 def test_only_letters_and_numbers_in_name(self):
     self.assertFalse(
         validator.name_validator("Lak6h3y 7adlani",
                                  self.name_regex_for_testing))
コード例 #10
0
 def test_only_letters_in_name(self):
     self.assertTrue(
         validator.name_validator("Lakshay Badlani",
                                  self.name_regex_for_testing))
コード例 #11
0
 def test_only_numbers_in_name(self):
     self.assertFalse(
         validator.name_validator("12345", self.name_regex_for_testing))
コード例 #12
0
 def test_empty_string(self):
     self.assertFalse(
         validator.name_validator("", self.name_regex_for_testing))