瀏覽代碼

add task and explanation of testability

oz123 11 年之前
父節點
當前提交
f4ad4e2817
共有 1 個文件被更改,包括 9 次插入3 次删除
  1. 9 3
      pwman/ui/cli.py

+ 9 - 3
pwman/ui/cli.py

@@ -423,7 +423,12 @@ class PwmanCli(cmd.Cmd):
         self.do_list(args)
 
     def do_list(self, args):
-
+        """
+        TODO: in order to make this code testable
+        The functionality in this method should
+        go to a method that returns a string.
+        This method should only do the printing.
+        """
         if len(args.split()) > 0:
             self.do_clear('')
             self.do_filter(args)
@@ -1051,8 +1056,9 @@ class PwmanCliNew(PwmanCli):
             nodes = self._db.getnodes(ids)
             for n in nodes:
                 try:
-                    b = tools.getyesno("Are you sure you want to delete '%s@%s'?"
-                                       % (n.username, n.url), False)
+                    b = tools.getyesno(("Are you sure you want to"
+                                        " delete '%s@%s'?"
+                                        ) % (n.username, n.url), False)
                 except NameError:
                     pass
                 if b is True: