示例#1
0
文件: tests.py 项目: davitv/chance
 def test_string_returns_string_from_correct_pool(self):
     pools = (
         'abcdef',
         'hjfj2131',
         '$553\&66hjfj2131',
         '=_-232fdsf',
     )
     for pool in pools:
         s = chance.string(pool=pool)
         for x in s:
             self.assertTrue(pool.find(x) != -1)
示例#2
0
文件: tests.py 项目: nhiggin5/chance
 def test_string_returns_string(self):
     for x in range(100):
         self.assertTrue(isinstance(chance.string(), text_type))
示例#3
0
文件: tests.py 项目: davitv/chance
 def test_string_returns_string_with_correct_length(self):
     for x in range(1, 100):
         self.assertTrue(len(chance.string(length=x)) == x)
示例#4
0
文件: tests.py 项目: davitv/chance
 def test_string_returns_string_with_correct_min_max(self):
     for x in range(1, 100):
         l = len(chance.string(minimum=x, maximum=x+5))
         self.assertTrue(x <= l <= (x+5))
示例#5
0
文件: tests.py 项目: davitv/chance
 def test_string_returns_string(self):
     for x in range(100):
         self.assertTrue(isinstance(chance.string(), text_type))