Merge lp:~longbow/kewpie/opt-matrix-optreq into lp:kewpie

Proposed by Valentine Gostev
Status: Merged
Merged at revision: 121
Proposed branch: lp:~longbow/kewpie/opt-matrix-optreq
Merge into: lp:kewpie
Diff against target: 31 lines (+18/-6)
1 file modified
lib/opts/matrix_manager.py (+18/-6)
To merge this branch: bzr merge lp:~longbow/kewpie/opt-matrix-optreq
Reviewer Review Type Date Requested Status
Patrick Crews Pending
Review via email: mp+94124@code.launchpad.net

Description of the change

Added validator to ensure all required options were given for test.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/opts/matrix_manager.py'
--- lib/opts/matrix_manager.py 2012-02-20 20:49:50 +0000
+++ lib/opts/matrix_manager.py 2012-02-22 11:21:22 +0000
@@ -26,9 +26,21 @@
26class matrixManager:26class matrixManager:
27 def __init__(self, variables):27 def __init__(self, variables):
28 if not variables['optmatrix']:28 if not variables['optmatrix']:
29 return None29 matrix_list=[]
30 matrix_list=[]30 for i in variables['optmatrix'].split(','):
31 for i in variables['optmatrix'].split(','):31 option_tuple = i.split('=')[0], i.split('=')[1]
32 option_tuple = i.split('=')[0], i.split('=')[1]32 matrix_list.append(option_tuple)
33 matrix_list.append(option_tuple)33 self.option_matrix = dict(matrix_list)
34 self.option_matrix = dict(matrix_list)34
35
36 def matrix_check_req(self, matrix_reqlist):
37 """Check requirements method assures that options required
38 for test were provided to --opt-matrix
39
40 """
41 while matrix_reqlist != []:
42 req_shift = matrix_reqlist.pop()
43 if not self.option_matrix[req_shift]:
44 raise KeyError('The required option %s missing from opt-matrix' %(req_shift))
45
46

Subscribers

People subscribed via source and target branches