Add a test case to demonstrate a bug in the allocator
authorSverre Rabbelier <srabbelier@gmail.com>
Fri, 10 Apr 2009 11:27:15 +0000
changeset 2142 573301607587
parent 2141 c45f18080cc7
child 2143 67c1cb524b78
Add a test case to demonstrate a bug in the allocator Patch by: Sverre Rabbelier
tests/app/soc/logic/test_allocations.py
--- a/tests/app/soc/logic/test_allocations.py	Thu Apr 09 22:37:29 2009 +0000
+++ b/tests/app/soc/logic/test_allocations.py	Fri Apr 10 11:27:15 2009 +0000
@@ -142,3 +142,18 @@
     actual = result['git']
 
     self.failUnlessEqual(expected, actual)
+
+  def testAllOrgsLocked(self):
+    """Test that when all orgs are locked the correct result is given.
+    """
+
+    locked_slots = {
+        'asf': 20,
+        'gcc': 15,
+        'git': 6,
+        'google': 3,
+        'melange': 3,
+        }
+
+    result = self.allocater.allocate(locked_slots)
+    self.failUnlessEqual(locked_slots, result)