Example #1
0
class TestNondigits(unittest.TestCase):
    def setUp(self):
        self.rs = Rstr()

    def test_nondigits(self):
        assert re.match('^\D{1,10}$', self.rs.nondigits())

    def test_nondigits_include(self):
        assert re.match('^\D*@\D*$', self.rs.nondigits(include='@'))

    def test_nondigits_exclude(self):
        for _ in xrange(0, 100):
            assert 'A' not in self.rs.nondigits(exclude='A')
Example #2
0
class TestNondigits(unittest.TestCase):
    def setUp(self):
        self.rs = Rstr()

    def test_nondigits(self):
        assert re.match('^\D{1,10}$', self.rs.nondigits())

    def test_nondigits_include(self):
        assert re.match('^\D*@\D*$', self.rs.nondigits(include='@'))

    def test_nondigits_exclude(self):
        for _ in xrange(0, 100):
            assert 'A' not in self.rs.nondigits(exclude='A')