Bug 240210

Summary: Resetting a class leads to sub-classes issue
Product: nepomuk Reporter: slauriere
Component: generalAssignee: Sebastian Trueg <sebastian>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Mandriva RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description slauriere 2010-05-31 13:12:35 UTC
Version:           unspecified (using Devel) 
OS:                Linux

The testcase below tends to show that the sub-classes of a class are not cleared before getting loaded again when the reset method is called.

----
#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
import unittest
from PyKDE4.nepomuk import Nepomuk
from PyQt4.QtCore import QUrl


class TestClass(unittest.TestCase):

    def setUp(self):
        self.seq = range(10)

    def testClassReset(self):
        clazz = Nepomuk.Types.Class(QUrl("http://www.semanticdesktop.org/ontologies/2007/11/01/pimo#Thing"))
        i = len(clazz.subClasses())
        clazz.reset()
        j = len(clazz.subClasses())
        self.assertEqual(i, j)

if __name__ == '__main__':
    unittest.main()
----



Reproducible: Always
Comment 1 Sebastian Trueg 2010-05-31 13:54:22 UTC
SVN commit 1132781 by trueg:

* Better error handling (no results is not an error)
* Do not reset the available variables before using them.

BUG: 240210


 M  +4 -7      class.cpp  
 M  +4 -7      entity.cpp  
 M  +4 -5      ontology.cpp  
 M  +2 -2      property.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1132781