[test-API PATCH] Fix a bug in the case that clean flag is used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



    When clean flag is used in testcase, the framework
    reports 'KeyError'.
    The bug is caused is by getting mod_case earlier
    than checking whether the 'clean' flag is present or not.
    The testcases without flag set doesn't be affected.
---
 src/generator.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/generator.py b/src/generator.py
index 6a46889..2e4ae07 100644
--- a/src/generator.py
+++ b/src/generator.py
@@ -115,11 +115,11 @@ class FuncGen(object):
             clean_flag = False
 
             mod_case_func = self.case_name_list[i]
-            mod_case = mod_case_func.rsplit(":", 1)[0]
             if mod_case_func.endswith(':clean'):
                 mod_case_func = mod_case_func[:-6]
                 clean_flag = True
 
+            mod_case = mod_case_func.rsplit(":", 1)[0]
             self.fmt.print_start(mod_case, env_logger)
 
             case_params = self.case_params_list[i]
-- 
1.7.7.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]