[Patchew-devel] [PATCH 11/11] tests: clean up duplicated defaulting in cli_login

Paolo Bonzini pbonzini at redhat.com
Wed May 15 12:58:08 UTC 2019


---
 tests/patchewtest.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tests/patchewtest.py b/tests/patchewtest.py
index d511954..2b1c3cd 100644
--- a/tests/patchewtest.py
+++ b/tests/patchewtest.py
@@ -93,11 +93,9 @@ class PatchewTestCase(dj_test.LiveServerTestCase):
         return a, b
 
     def cli_login(self, username=None, password=None):
-        if not username:
-            username = self.user
-        if not password:
-            password = self.password
-        self.check_cli(["login", username or self.user, password or self.password])
+        username = username or self.user
+        password = password or self.password
+        self.check_cli(["login", username, password])
 
     def cli_logout(self):
         self.check_cli(["logout"])
-- 
2.21.0




More information about the Patchew-devel mailing list