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))
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))
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))
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))
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))
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))
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))
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))
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))