MCPcopy Create free account
hub / github.com/SegataLab/lefse / funcIsValidClass

Method funcIsValidClass

lefsebiom/ValidateData.py:600–624  ·  view source on GitHub ↗

Validates a parameter as a valid class (of a specifc type given by name). :param parameterValue: Value to be evaluated. :type Unknown :param strCorrectName: Name of te class the parameter should be. :type Unknown :return Boolean: True indicates the p

(parameterValue, strCorrectName)

Source from the content-addressed store, hash-verified

598 #Tested 5
599 @staticmethod
600 def funcIsValidClass(parameterValue, strCorrectName):
601 """
602 Validates a parameter as a valid class (of a specifc type given by name).
603
604 :param parameterValue: Value to be evaluated.
605 :type Unknown
606 :param strCorrectName: Name of te class the parameter should be.
607 :type Unknown
608 :return Boolean: True indicates the parameter is a valid value.
609 :type Boolean
610 """
611
612 if(parameterValue==None):
613 return False
614 if not ValidateData.funcIsValidString(strCorrectName):
615 return False
616 classType = type(parameterValue).__name__
617 if(classType == strCorrectName):
618 return True
619 if(classType == 'instance'):
620 if(parameterValue.__class__.__name__==strCorrectName):
621 return True
622 else:
623 return False
624 return False

Callers

nothing calls this directly

Calls 1

funcIsValidStringMethod · 0.80

Tested by

no test coverage detected