6
# A representation of a skel test plan that is stored in a yaml document
8
def __init__ (self, filename):
9
stream = file (filename, 'r')
10
self.doc = yaml.load(stream)
14
# Returns a list of test objects that implement the test plan
18
for i in range (len (self.doc) ): # Assume each element of doc is a test
19
tests.append (test (self.doc[i]['procs'], self.doc[i]['name'], self.doc[i]['method'], self.doc[i]['parameters'], self.doc[i]['decomp-procs']) )
21
# This is the old way, convenient, but lacking in flexibility
23
#for i in range (len(self.doc['procs']) ):
24
# for j in range (len(self.doc['methods']) ):
25
# name = "T%s_%i" % (chr (ord('a') + j), self.doc['procs'][i])
26
# tests.append (test (self.doc['procs'][i], name,
27
# self.doc['methods'][j]['m'],
28
# self.doc['methods'][j]['p']) )
34
def __init__ (self, num_procs, subdir, method, parameters, decomp_procs):
35
self.num_procs = num_procs
38
self.parameters = parameters
39
self.decomp_procs = decomp_procs
41
def get_subdir (self):
44
def get_method (self):
47
def get_parameters (self):
48
return self.parameters
50
def get_decomp_procs (self):
51
return self.decomp_procs
54
return "procs: %s\nmethod: %s\nparameters: %s\ndecomp_procs: %s" % (self.num_procs, self.method, self.parameters, self.decomp_procs)
60
b = skel_test_plan ("test_plan.yaml")
65
if __name__ == "__main__":