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)
def test_string_returns_string(self): for x in range(100): self.assertTrue(isinstance(chance.string(), text_type))
def test_string_returns_string_with_correct_length(self): for x in range(1, 100): self.assertTrue(len(chance.string(length=x)) == x)
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))
def test_string_returns_string(self): for x in range(100): self.assertTrue(isinstance(chance.string(), text_type))