| 7 | |
| 8 | |
| 9 | class TestFunctional(unittest.TestCase): |
| 10 | def test_length_below_the_minimum(self): |
| 11 | p = pexpect.spawn( |
| 12 | "python3 lesspass/core.py site login masterpassword --lowercase --digits --length 2" |
| 13 | ) |
| 14 | output = p.read().decode() |
| 15 | |
| 16 | self.assertTrue( |
| 17 | "error: argument -L/--length: 2 is out of range, choose in [5-35]" in output |
| 18 | ) |
| 19 | |
| 20 | def test_length_range_type(self): |
| 21 | self.assertEqual(range_type("5"), 5) |
| 22 | self.assertEqual(range_type("35"), 35) |
| 23 | with self.assertRaises(argparse.ArgumentTypeError): |
| 24 | range_type("2") |
| 25 | |
| 26 | def test_exclude(self): |
| 27 | p = pexpect.spawn( |
| 28 | 'python3 lesspass/core.py site login masterpassword --exclude "!@$*+-8"' |
| 29 | ) |
| 30 | output = p.read().decode() |
| 31 | for c in "!@$*+-8": |
| 32 | self.assertTrue(c not in output) |
| 33 | |
| 34 | def test_exclude(self): |
| 35 | p = pexpect.spawn( |
| 36 | 'python3 lesspass/core.py site login masterpassword -d -L6 --exclude "0123456789"' |
| 37 | ) |
| 38 | output = p.read().decode() |
| 39 | |
| 40 | self.assertTrue("error: you can't exclude all chars available" in output) |
nothing calls this directly
no outgoing calls
no test coverage detected