def testIsConstrainedStringExactPass (self): # Setup with file known to exist, with section and key known to exist. tstCV = ConfigValues (self.EXISTING_FILENAME) tstCV.InitConfig() resultStr = tstCV.GetOption (self.EXISTING_SECTIONNAME, self.EXISTING_KEYNAME_STRING) assert ConfigValues.isConstrainedString (resultStr, self.EXISTING_KEY_STRINGVALUE) == True
def testIsConstrainedStringContainsFail (self): # Setup with file known to exist, with section and key known to exist. tstCV = ConfigValues (self.EXISTING_FILENAME) tstCV.InitConfig() # List of strings which does NOT contain the string to be tested. testStringValues = list(["sixOfOne", "halfDozenOfTheOther"]) resultStr = tstCV.GetOption (self.EXISTING_SECTIONNAME, self.EXISTING_KEYNAME_STRING) assert ConfigValues.isConstrainedString (resultStr, testStringValues) == False