Exemplo n.º 1
0
 def test_random_text(self):
     func = random_text()
     text = func()
     self.assertRegexpMatches(text, r'^[a-zA-Z]{10}$')
     text2 = func()
     self.assertNotEqual(text, text2)
Exemplo n.º 2
0
 def test_random_text_with_other_chars(self):
     func = random_text(1000, other_chars=[',', '.'])
     text = func()
     self.assertNotRegexpMatches(text, r'^[a-zA-Z]{1000}$')
     self.assertRegexpMatches(text, r'^[a-zA-Z.,]{1000}$')
Exemplo n.º 3
0
 def test_random_text_with_no_uppercase(self):
     func = random_text(1000, upper=False)
     text = func()
     self.assertRegexpMatches(text, r'^[a-z]{1000}$')
Exemplo n.º 4
0
 def test_random_text_with_spaces(self):
     func = random_text(1000, spaces=True)
     text = func()
     self.assertNotRegexpMatches(text, r'^[a-zA-Z]{1000}$')
     self.assertRegexpMatches(text, r'^[a-zA-Z\s]{1000}$')
Exemplo n.º 5
0
 def test_random_text_with_digits(self):
     func = random_text(1000, digits=True)
     text = func()
     self.assertNotRegexpMatches(text, r'^[a-zA-Z]{1000}$')
     self.assertRegexpMatches(text, r'^[a-zA-Z0-9]{1000}$')
Exemplo n.º 6
0
 def test_random_text_of_length(self):
     func = random_text(15)
     text = func()
     self.assertEqual(15, len(text))
Exemplo n.º 7
0
 def test_random_text_of_length(self):
     func = random_text(15)
     text = func()
     self.assertEqual(15, len(text))
Exemplo n.º 8
0
 def test_random_text(self):
     func = random_text()
     text = func()
     self.assertRegexpMatches(text, r'^[a-zA-Z]{10}$')
     text2 = func()
     self.assertNotEqual(text, text2)
Exemplo n.º 9
0
 def test_random_text_with_no_uppercase(self):
     func = random_text(1000, upper=False)
     text = func()
     self.assertRegexpMatches(text, r'^[a-z]{1000}$')
Exemplo n.º 10
0
 def test_random_text_with_other_chars(self):
     func = random_text(1000, other_chars=[',','.'])
     text = func()
     self.assertNotRegexpMatches(text, r'^[a-zA-Z]{1000}$')
     self.assertRegexpMatches(text, r'^[a-zA-Z.,]{1000}$')
Exemplo n.º 11
0
 def test_random_text_with_digits(self):
     func = random_text(1000, digits=True)
     text = func()
     self.assertNotRegexpMatches(text, r'^[a-zA-Z]{1000}$')
     self.assertRegexpMatches(text, r'^[a-zA-Z0-9]{1000}$')
Exemplo n.º 12
0
 def test_random_text_with_spaces(self):
     func = random_text(1000, spaces=True)
     text = func()
     self.assertNotRegexpMatches(text, r'^[a-zA-Z]{1000}$')
     self.assertRegexpMatches(text, r'^[a-zA-Z\s]{1000}$')