def test_cfg_read(self):
     '''
     Tests accessibility of cfg file, does not check format
     '''
     global cfglines
     CFPropertyManager.startClient()
     fo = open("cf-property-manager-test-cfg", "w+")
     fo.write("devName=[{][^:}][^:}]*\ndevType=[:][^{]*?[:}](?!.*[{])\nIGNORE=.*WtrSkid.*");
     fo.close()
     cfglines = CFPropertyManager.readConfiguration("cf-property-manager-test-cfg")
     for line in cfglines:
         self.assertTrue(line in CFPropertyManager.cfglines)
     return cfglines
    def test_regex_error(self):
        '''
        Tests bad regex error raise.
        '''
        fo = open("cf-property-manager-test-bad-cfg", "w+")
        fo.write("property=[");
        fo.close()
        cfglines=cfglines = CFPropertyManager.readConfiguration("cf-property-manager-test-bad-cfg")
        for properties in cfglines:
            print properties[0] + " = " + properties[1]
            try:
                self.assertRaises(Exception, re.compile, properties[1])

            except Exception as e:
                print 'Invalid regular expression: ',properties[1]
                print 'CAUSE:',e.message
        os.remove("cf-property-manager-test-bad-cfg")
        return cfglines