Lines Matching refs:self

66   def __init__(self):
70 self.tests = set()
72 def add_test(self, ty):
76 self.tests.add(Func(ty))
78 def get_expected(self):
82 all_tests = sorted(self.tests)
85 def get_name(self):
91 def __str__(self):
95 all_tests = sorted(self.tests)
101 test_invoke += self.TEST_GROUP_INVOKE_TEMPLATE.format(test_name=t.get_name())
102 main_func = self.MAIN_FUNCTION_TEMPLATE.format(test_group_invoke=test_invoke)
104 return self.MAIN_CLASS_TEMPLATE.format(copyright = get_copyright('java'),
138 def __init__(self, farg):
142 self.farg = farg
144 def __str__(self):
148 return self.TEST_FUNCTION_TEMPLATE.format(fname=self.get_name(),
149 farg=self.farg.get_name(),
150 tree = self.farg.get_tree())
152 def get_name(self):
156 return "TEST_FUNC_{}".format(self.farg.get_name())
158 def get_expected(self):
162 return self.OUTPUT_FORMAT.format(
163 tree = self.farg.get_tree(),
164 initialize_output = self.farg.get_initialize_output().strip(),
165 touch_output = self.farg.get_touch_output().strip())
194 def __init__(self, ifaces):
198 self.ifaces = ifaces
199 self.class_name = "CLASS_"+gensym()
201 def get_name(self):
205 return self.class_name
207 def get_tree(self):
211 return "[{fname} {iftree}]".format(fname = self.get_name(), iftree = print_tree(self.ifaces))
213 def get_initialize_output(self):
214 return "\n".join(map(lambda i: i.get_initialize_output().strip(), dump_tree(self.ifaces)))
216 def get_touch_output(self):
217 return "\n".join(map(lambda a: self.TOUCH_OUTPUT_TEMPLATE.format(
218 class_name = self.class_name,
221 self.get_all_interfaces()))
223 def get_all_interfaces(self):
227 return sorted(set(dump_tree(self.ifaces)))
229 def __str__(self):
233 j_ifaces = ', '.join(map(lambda a: a.get_name(), self.ifaces))
234 touches = '\n'.join(map(lambda a: self.TOUCH_CALL_TEMPLATE.format(class_name = self.class_name,
236 self.get_all_interfaces()))
237 return self.TEST_CLASS_TEMPLATE.format(copyright = get_copyright('java'),
239 class_name = self.class_name,
261 def __init__(self, ifaces, default):
265 self.ifaces = ifaces
266 self.default = default
268 self.class_name = "INTERFACE_"+gensym()+end
269 self.cloned = False
270 self.initialized = False
272 def clone(self):
277 return TestInterface(tuple(map(lambda a: a.clone(), self.ifaces)), self.default)
279 def get_name(self):
283 return self.class_name
285 def __iter__(self):
290 for i in self.ifaces:
294 def get_tree(self):
298 return "[{class_name} {iftree}]".format(class_name = self.get_name(),
299 iftree = print_tree(self.ifaces))
301 def get_initialize_output(self):
305 if self.default and not self.initialized:
306 self.initialized = True
307 return self.OUTPUT_TEMPLATE.format(tree = self.get_tree())
311 def get_touch_output(self):
315 if not self.default and not self.initialized:
316 self.initialized = True
317 return self.OUTPUT_TEMPLATE.format(tree = self.get_tree())
321 def __str__(self):
325 j_ifaces = ', '.join(map(lambda a: a.get_name(), self.ifaces))
326 if self.default:
327 funcs = self.DEFAULT_FUNC_TEMPLATE.format(class_name = self.class_name)
330 return self.TEST_INTERFACE_TEMPLATE.format(copyright = get_copyright('java'),
331 extends = "extends" if len(self.ifaces) else "",
334 tree = self.get_tree(),
335 class_name = self.class_name)