In reviewing the 'workitem' class, I inadvertently
broke an instance by making a couple of unexpected
calls:
- I called 'addTo' with a single ID (a string);
this didn't blow up, but didn't behave as desired,
either.
- I called 'unblock' one too many times.
Here is a patch:
--- workitem.py 4 Jan 2002 11:41:02 -0000 1.7
+++ workitem.py 11 Mar 2002 20:45:14 -0000
@@ -26,6 +26,8 @@
def addTo(self, id_list):
+ if type( id_list ) == type( '' ):
+ id_list = [ id_list ]
self._workitems_to.extend(id_list)
self._p_changed=1
@@ -58,6 +60,8 @@
def unblock(self, value=1):
self._blocked = self._blocked - value
+ if self._blocked < 0:
+ self._blocked = 0
def changeStatus(self, status):
Attached are unittests which exercises both bugs.
unittest
Patch file