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

Method funcIsValidPositiveInteger

lefsebiom/ValidateData.py:123–146  ·  view source on GitHub ↗

Validates a parameter as false. :param parameterValue: Value to be evaluated. :type Unknown :param tempZero: Allows one to set what the value for zero should return. :type Boolean The return value for zero. :return Boolean: True indicates the paramet

(parameterValue, tempZero = False)

Source from the content-addressed store, hash-verified

121 #Tested 5
122 @staticmethod
123 def funcIsValidPositiveInteger(parameterValue, tempZero = False):
124 """
125 Validates a parameter as false.
126
127 :param parameterValue: Value to be evaluated.
128 :type Unknown
129 :param tempZero: Allows one to set what the value for zero should return.
130 :type Boolean The return value for zero.
131 :return Boolean: True indicates the parameter is a positive integer.
132 :type Boolean
133 """
134
135 #Check to make sure it is not null
136 if not ValidateData.funcIsValidInteger(parameterValue):
137 return False
138
139 #Check to see it is positive
140 if (parameterValue < 0):
141 return False
142
143 #Check for zero value
144 if(parameterValue == 0):
145 return tempZero
146 return True
147
148 #Tested 14
149 @staticmethod

Calls 1

funcIsValidIntegerMethod · 0.80

Tested by

no test coverage detected