25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

14 lines
330 B

  1. import unittest
  2. import pexpect
  3. import signal
  4. import time
  5. class TestInteraction(unittest.TestCase):
  6. def test_keyboard_interrupt(self):
  7. p = pexpect.spawn("python3 lesspass/core.py --prompt")
  8. p.expect("Site: ")
  9. p.kill(signal.SIGINT)
  10. p.expect(pexpect.EOF)
  11. self.assertEqual(p.before, b"")