Procházet zdrojové kódy

add task and explanation of testability

oz123 před 11 roky
rodič
revize
f4ad4e2817
1 změnil soubory, kde provedl 9 přidání a 3 odebrání
  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: