Exemple #1
0
 def testIsOk(self):
     """Test IsOk method"""
     tmp_h = syntax.SyntaxModeHandler(self.path)
     tmp_h.LoadFromDisk()
     self.assertTrue(tmp_h.IsOk())
     self.assertTrue(tmp_h.Ok)
     tmp_h = syntax.SyntaxModeHandler(self.bad)
     tmp_h.LoadFromDisk()
     self.assertFalse(tmp_h.IsOk())
     self.assertFalse(tmp_h.Ok)
Exemple #2
0
    def testGetXml(self):
        """Test getting the xml representation"""
        tmp_h = syntax.SyntaxModeHandler()
        tmp_h.LoadFromString(self.xml)

        x1 = self.fhandle.GetXml()
        x2 = tmp_h.GetXml()
        self.assertEquals(x1, x2)
Exemple #3
0
    def setUp(self):
        self.path = common.GetDataFilePath(u'syntax.xml')
        self.bad = common.GetDataFilePath(u'bad.xml')
        self.xml = common.GetFileContents(self.path)
        self.badxml = common.GetFileContents(self.bad)

        self.fhandle = syntax.SyntaxModeHandler(self.path)
        self.fhandle.LoadFromDisk()