Explorar o código

improve tests

oz123 %!s(int64=11) %!d(string=hai) anos
pai
achega
a3ece48278
Modificáronse 2 ficheiros con 4 adicións e 3 borrados
  1. 2 1
      pwman/tests/db_tests.py
  2. 2 2
      pwman/ui/cli.py

+ 2 - 1
pwman/tests/db_tests.py

@@ -128,7 +128,8 @@ class CLITests(unittest.TestCase):
         self.assertEqual(url, 'example.com')
 
     def test_get_notes(self):
-        pass
+        notes = self.tester.cli.get_notes(reader=lambda: 'test 123\n test 456')
+        self.assertEqual(notes, 'test 123\n test 456')
 
     def test_get_tags(self):
         pass

+ 2 - 2
pwman/ui/cli.py

@@ -128,10 +128,10 @@ class PwmanCliOld(cmd.Cmd, HelpUI, BaseUI):
         return password
 
     def get_url(self, default="", reader=raw_input):
-        return tools.getinput("Url: ", default)
+        return tools.getinput("Url: ", default, reader)
 
     def get_notes(self, default="", reader=raw_input):
-        return tools.getinput("Notes: ", default)
+        return tools.getinput("Notes: ", default, reader)
 
     def get_tags(self, default=None):
         """read node tags from user"""