Exemplo n.º 1
0
 def test_is_alpha(self):
     self.assertTrue(StringValidator.is_alpha('abc'))
     self.assertTrue(StringValidator.is_alpha('ABC'))
Exemplo n.º 2
0
 def test_startswith(self):
     self.assertTrue(StringValidator.startswith('hi there', 'hi'))
Exemplo n.º 3
0
 def test_not_startswith(self):
     self.assertFalse(StringValidator.startswith('oh hi', 'hi'))
Exemplo n.º 4
0
 def test_not_endswith(self):
     self.assertFalse(StringValidator.endswith('hi there', 'hi'))
Exemplo n.º 5
0
 def test_endswith(self):
     self.assertTrue(StringValidator.endswith('oh hi', 'hi'))
Exemplo n.º 6
0
 def test_is_not_empty(self):
     self.assertFalse(StringValidator.is_empty('TX'))
     self.assertFalse(StringValidator.is_empty('  TX '))
Exemplo n.º 7
0
 def test_is_empty(self):
     self.assertTrue(StringValidator.is_empty(''))
     self.assertTrue(StringValidator.is_empty('   '))
Exemplo n.º 8
0
 def test_is_not_alpha(self):
     self.assertFalse(StringValidator.is_alpha('123'))
     self.assertFalse(StringValidator.is_alpha('abc123'))
     self.assertFalse(StringValidator.is_alpha('a1b2c3'))
     self.assertFalse(StringValidator.is_alpha('123ABC'))