Bug 240210 - Resetting a class leads to sub-classes issue
Summary: Resetting a class leads to sub-classes issue
Status: RESOLVED FIXED
Alias: None
Product: nepomuk
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Mandriva RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Trueg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-31 13:12 UTC by slauriere
Modified: 2010-05-31 13:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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