示例#1
0
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))
示例#2
0
 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)
示例#3
0
 def setUp(self):
     self.base_tpl = file_to_str(SUB_WHAM_BASE_TPL)
     self.line_tpl = file_to_str(SUB_WHAM_LINE_TPL)
示例#4
0
 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)
示例#5
0
 def setUp(self):
     self.base_tpl = file_to_str(SUB_WHAM_BASE_TPL)
     self.line_tpl = file_to_str(SUB_WHAM_LINE_TPL)