def read_tpl(tpl_loc): """Attempts to read the given template location and throws A TemplateNotReadableError if it can't read the given location. :param tpl_loc: The template location to read. :raise TemplateNotReadableError: If there is an IOError reading the location. """ try: return file_to_str(tpl_loc) except IOError: raise TemplateNotReadableError(TPL_IO_ERR_MSG.format(tpl_loc))
def testFillSubmit(self): wham_fill = fill_submit_wham(self.base_tpl, self.line_tpl, 5) self.assertEqual(file_to_str(SUBMIT_05_PATH), wham_fill)
def setUp(self): self.base_tpl = file_to_str(SUB_WHAM_BASE_TPL) self.line_tpl = file_to_str(SUB_WHAM_LINE_TPL)