import unittest
from passgen import passgen


class TestPassgen(unittest.TestCase):

    def test_errors(self):
        with self.assertRaises(ValueError):
            passgen(length=-2)

        with self.assertRaises(ValueError):
            passgen(case="spam")

        with self.assertRaises(ValueError):
            passgen(digits=False, letters=False)

    def test_case(self):
        password = passgen(case='upper')
        self.assertEqual(password, password.upper())

        password = passgen(case='lower')
        self.assertEqual(password, password.lower())

    def test_length(self):
        password = passgen(length=10)
        self.assertEqual(len(password), 10)

        password = passgen(length=15, case='upper', digits=False)
        self.assertEqual(len(password), 15)

if __name__ == '__main__':
    unittest.main()

@@ -9,16 +9,26 @@
 nittest%0A
+import re%0A
 from pas
@@ -799,16 +799,658 @@
 ), 15)%0A%0A
+    def test_limit_punctuation(self):%0A        pl = '.'%0A        password = passgen(letters=True, digits=False, length=6,%0A                           punctuation=True, limit_punctuation=pl)%0A        password = re.sub(r%22%5Ba-zA-Z.%5D%22, %22%22, password)%0A        self.assertTrue(password == '')%0A%0A    def test_only_letters(self):%0A        password = passgen(letters=True, digits=False)%0A        password = re.sub(r%22%5Ba-zA-Z%5D%22, %22%22, password)%0A        self.assertTrue(password == '')%0A%0A    def test_only_digits(self):%0A        password = passgen(letters=False, digits=True)%0A        password = re.sub(r%22%5B0-9%5D%22, %22%22, password)%0A        self.assertTrue(password == '')%0A%0A
 if __nam

Add more tests