예제 #1
0
 def test_interest_units(self):
     """
     This method checks that interesting PVs have units
     """
     failures = db_checks.get_interest_units(self.db)
     self.assertEqual(len(failures),
                      0,
                      msg=db_checks.build_failure_message(
                          "Interesting PVs with no units in {}".format(
                              self.db.directory), failures))
예제 #2
0
 def test_multiple_pvs_warning(self):
     """
     This method warns if there are multiple PVs with the same name in the project
     """
     failures = db_checks.get_multiple_instances(self.db)
     self.assertEqual(len(failures),
                      0,
                      msg=db_checks.build_failure_message(
                          "Multiple fields on PVs in {}".format(
                              self.db.directory), failures))
예제 #3
0
 def test_multiple_properties_on_pvs(self):
     """
     This method checks that interesting PVs have units
     """
     failures = db_checks.get_multiple_properties_on_pvs(self.db)
     self.assertEqual(len(failures),
                      0,
                      msg=db_checks.build_failure_message(
                          "Multiple fields on PVs in {}".format(
                              self.db.directory), failures))
예제 #4
0
 def test_interest_descriptions(self):
     """
     This method checks all records marked as interesting for description fields
     """
     failures = db_checks.get_interest_descriptions(self.db)
     self.assertEqual(len(failures),
                      0,
                      msg=db_checks.build_failure_message(
                          "Missing description in {}".format(
                              self.db.directory), failures))
예제 #5
0
 def test_units_valid(self):
     """
     This method loops through all found records and finds the unique units. It then checks these units are standard
     """
     failures = db_checks.get_units_valid(self.db)
     self.assertEqual(len(failures),
                      0,
                      msg=db_checks.build_failure_message(
                          "Invalid units in {}".format(self.db.directory),
                          failures))
예제 #6
0
 def test_desc_length(self):
     """
     This method checks that the description length on all PVs is no longer than 40 chars
     """
     failures = db_checks.get_desc_length(self.db)
     self.assertEqual(len(failures),
                      0,
                      msg=db_checks.build_failure_message(
                          "Description too long in {}".format(
                              self.db.directory), failures))
예제 #7
0
 def test_interest_calc_readonly(self):
     """
     This method checks that interesting PVs that are calc fields are set to
     readonly
     """
     failures = db_checks.get_interest_calc_readonly(self.db)
     self.assertEqual(len(failures),
                      0,
                      msg=db_checks.build_failure_message(
                          "Writable calc records in {}".format(
                              self.db.directory), failures))
예제 #8
0
 def test_log_info_tags(self):
     """
     This method checks logging records to check that logging tags are not repeated and that the period is not
     defined in two ways.
     """
     failures = db_checks.get_log_info_tags(self.db)
     self.assertEqual(len(failures),
                      0,
                      msg=db_checks.build_failure_message(
                          "Duplicated log infos in {}".format(
                              self.db.directory), failures))
예제 #9
0
 def test_interest_syntax(self):
     """
     This method tests that all interesting PVs that are not in the names exception list are capitalised and
     contain only A-Z 0-9 _ :
     """
     failures = db_checks.get_interest_syntax(self.db)
     self.assertEqual(len(failures),
                      0,
                      msg=db_checks.build_failure_message(
                          "PV syntax incorrect in {}".format(
                              self.db.directory), failures))