示例#1
0
 def runTest(self):
     """test templating documentation"""
     doc = easyconfig.generate_template_values_doc()
     # expected length: 1 per constant and 1 extra per constantgroup
     temps = [
              easyconfig.TEMPLATE_NAMES_EASYCONFIG,
              easyconfig.TEMPLATE_NAMES_CONFIG,
              easyconfig.TEMPLATE_NAMES_LOWER,
              easyconfig.TEMPLATE_NAMES_EASYBLOCK_RUN_STEP,
              easyconfig.TEMPLATE_CONSTANTS,
              easyconfig.EASYCONFIG_CONSTANTS,
             ]
     self.assertEqual(len(doc.split('\n')), sum([len(temps)] + [len(x) for x in temps]))
示例#2
0
    def _postprocess_list_avail(self):
        """Create all the additional info that can be requested (exit at the end)"""
        msg = ''
        # dump possible easyconfig params
        if self.options.avail_easyconfig_params:
            msg += self.avail_easyconfig_params()

        # dump easyconfig template options
        if self.options.avail_easyconfig_templates:
            msg += generate_template_values_doc()

        # dump available easyblocks
        if self.options.list_easyblocks:
            msg += self.avail_easyblocks()

        # dump known toolchains
        if self.options.list_toolchains:
            msg += self.avail_toolchains()

        if self.options.unittest_file:
            self.log.info(msg)
        else:
            print msg
        sys.exit(0)