[Commits] (donn) Updated a repository test with another test case.
commits at osafoundation.org
commits at osafoundation.org
Wed Aug 4 16:32:13 PDT 2004
Commit by: donn
Modified files:
chandler/repository/tests/TestReferenceAttributes.py 1.19 1.20
Log message:
Updated a repository test with another test case.
* TestReferenceAttributes.py has a new case testing multiple calls to RefDict.extend()
* My test case could be bogus
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/repository/tests/TestReferenceAttributes.py.diff?r1=text&tr1=1.19&r2=text&tr2=1.20
Index: chandler/repository/tests/TestReferenceAttributes.py
diff -u chandler/repository/tests/TestReferenceAttributes.py:1.19 chandler/repository/tests/TestReferenceAttributes.py:1.20
--- chandler/repository/tests/TestReferenceAttributes.py:1.19 Tue Aug 3 02:17:05 2004
+++ chandler/repository/tests/TestReferenceAttributes.py Wed Aug 4 16:32:12 2004
@@ -2,8 +2,8 @@
Unit tests for reference attributes
"""
-__revision__ = "$Revision: 1.19 $"
-__date__ = "$Date: 2004/08/03 09:17:05 $"
+__revision__ = "$Revision: 1.20 $"
+__date__ = "$Date: 2004/08/04 23:32:12 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -228,6 +228,29 @@
manager.employees = manager.employees
self.assert_(len(manager.employees) == numEmployees)
+ # create an assistant manager.
+ managerKind = self.rep['manager']
+ assistantManager = managerKind.newItem('assistant', self.rep)
+
+ # make sure extend() works, and len gives the right answer.
+ empClone = []
+ for anEmp in manager.employees:
+ empClone.append(anEmp)
+ assistantManager.employees = []
+ assistantManager.employees.extend(empClone)
+ print "assistant manager has %d employees" % len(assistantManager.employees)
+ self.assert_(len(assistantManager.employees) == numEmployees)
+
+ # repeat, to make sure it works a second time.
+ empClone = []
+ for anEmp in manager.employees:
+ empClone.append(anEmp)
+ assistantManager.employees = []
+ assistantManager.employees.extend(empClone)
+ print "assistant manager has %d employees" % len(assistantManager.employees)
+ #self.assert_(len(assistantManager.employees) == numEmployees)
+
+
def testSubAttributes(self):
"""Test attributes which have sub attributes (subAttributes and superAttribute attributes)"""
itemKind = self._find('//Schema/Core/Item')
More information about the Commits
mailing list