def test_hepspec_valid(self):
     """
     Make sure a valid HEPSPEC value is accepted.
     """
     did_fail = False
     config_parser = configparser.SafeConfigParser()
     config_file = get_test_config("subcluster/sc_samples.ini")
     config_parser.read(config_file)
     try:
         subcluster.check_section(config_parser, "Subcluster Valid")
     except exceptions.SettingError:
         did_fail = True
     self.assertFalse(did_fail,
                      msg="Valid HEPSPEC entry threw an exception.")
 def test_hepspec_invalid(self):
     """
     Make sure a invalid HEPSPEC value no longer causes an error..
     """
     config_parser = configparser.SafeConfigParser()
     config_file = get_test_config("subcluster/sc_samples.ini")
     config_parser.read(config_file)
     try:
         subcluster.check_section(config_parser, "Subcluster Bad HEPSPEC")
     except exceptions.SettingError:
         self.fail(msg="Invalid HEPSPEC entry threw an exception.")
     try:
         subcluster.check_section(config_parser,
                                  "Subcluster Formerly Bad Cores")
     except exceptions.SettingError:
         self.fail(msg="Formerly Bad Cores entry threw an exception")
 def test_resource_entry_2(self):
     """
     Make sure most subcluster attributes are optional for a
     Resource Entry section
     """
     config_parser = configparser.SafeConfigParser()
     config_file = get_test_config("subcluster/resourceentry.ini")
     config_parser.read(config_file)
     did_fail = False
     for section in [
             "Resource Entry Valid Old Attribs",
             "Resource Entry Valid New Attribs"
     ]:
         try:
             subcluster.check_section(config_parser, section)
         except exceptions.SettingError:
             did_fail = True
         self.assertFalse(did_fail,
                          msg="Section %s threw an exception." % section)