Exemplo n.º 1
0
 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
Exemplo n.º 2
0
    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