[Commits] (donn) Fixed the repository test case just commited and made it simpler.

commits at osafoundation.org commits at osafoundation.org
Wed Aug 4 17:09:19 PDT 2004


Commit by: donn
Modified files:
chandler/repository/tests/TestReferenceAttributes.py 1.20 1.21

Log message:
Fixed the repository test case just commited and made it simpler.
    * The last version was bogus
    * I have better confidence this version should work

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/repository/tests/TestReferenceAttributes.py.diff?r1=text&tr1=1.20&r2=text&tr2=1.21

Index: chandler/repository/tests/TestReferenceAttributes.py
diff -u chandler/repository/tests/TestReferenceAttributes.py:1.20 chandler/repository/tests/TestReferenceAttributes.py:1.21
--- chandler/repository/tests/TestReferenceAttributes.py:1.20	Wed Aug  4 16:32:12 2004
+++ chandler/repository/tests/TestReferenceAttributes.py	Wed Aug  4 17:09:17 2004
@@ -2,8 +2,8 @@
 Unit tests for reference attributes
 """
 
-__revision__  = "$Revision: 1.20 $"
-__date__      = "$Date: 2004/08/04 23:32:12 $"
+__revision__  = "$Revision: 1.21 $"
+__date__      = "$Date: 2004/08/05 00:09:17 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -228,28 +228,15 @@
         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)
-
+        print "manager has %d employees" % len(manager.employees)
+        manager.employees = empClone
+        print "manager has %d employees" % len(manager.employees)
+        print "manager has %d employee values" % len(manager.employees.values())
+        #self.assert_(len(manager.employees) == numEmployees)
 
     def testSubAttributes(self):
         """Test attributes which have sub attributes (subAttributes and superAttribute attributes)"""



More information about the Commits mailing list