|
|
@@ -1,13 +1,11 @@ |
|
|
|
import unittest |
|
|
|
import pexpect |
|
|
|
import signal |
|
|
|
import time |
|
|
|
|
|
|
|
import sys |
|
|
|
|
|
|
|
import argparse |
|
|
|
from lesspass.cli import range_type |
|
|
|
|
|
|
|
|
|
|
|
class TestFunctional(unittest.TestCase): |
|
|
|
def test_length_below_the_minimum(self): |
|
|
|
p = pexpect.spawn( |
|
|
@@ -15,13 +13,15 @@ class TestFunctional(unittest.TestCase): |
|
|
|
) |
|
|
|
output = p.read().decode() |
|
|
|
|
|
|
|
self.assertTrue("error: argument -L/--length: 2 is out of range, choose in [5-35]" in output) |
|
|
|
self.assertTrue( |
|
|
|
"error: argument -L/--length: 2 is out of range, choose in [5-35]" in output |
|
|
|
) |
|
|
|
|
|
|
|
def test_length_range_type(self): |
|
|
|
self.assertEqual(range_type('5'), 5) |
|
|
|
self.assertEqual(range_type('35'), 35) |
|
|
|
self.assertEqual(range_type("5"), 5) |
|
|
|
self.assertEqual(range_type("35"), 35) |
|
|
|
with self.assertRaises(argparse.ArgumentTypeError): |
|
|
|
range_type('2') |
|
|
|
range_type("2") |
|
|
|
|
|
|
|
def test_exclude(self): |
|
|
|
p = pexpect.spawn( |
|
|
|