Skip to content
Browse files

Bug fix.

  • Loading branch information...
1 parent 058183b commit be8e5843c33c0734a36b9c96ba44975df9716ed8 Dan Lecocq committed Apr 30, 2012
Showing with 13 additions and 2 deletions.
  1. +1 −1 qless/qless-core
  2. +12 −1 test.py
2 qless/qless-core
@@ -1 +1 @@
-Subproject commit dc565c15a799c484ce4b049bfbbfc6f15667574a
+Subproject commit 2cbe1b21f387838aecfb1249dbf6a156e0214c97
View
13 test.py
@@ -157,7 +157,18 @@ def test_depends_canceled(self):
a = self.q.put(qless.Job, {'test': 'cancel_dependency'})
b = self.q.put(qless.Job, {'test': 'cancel_dependency'}, depends=[a])
- self.assertRaises(Exception, self.client.jobs[a].cancel)
+ try:
+ self.client.jobs[a].cancel()
+ self.assertTrue(False, 'We should not be able to cancel jobs with dependencies')
+ except Exception as e:
+ self.assertTrue('Cancel()' in e.message, 'Cancel() threw the wrong error')
+
+ # When canceling a job, we should remove that job from the jobs' list
+ # of dependents.
+ self.client.jobs[b].cancel()
+ self.assertEqual(self.client.jobs[a].dependents, [])
+ # We should also just be able to cancel a now
+ self.client.jobs[a].cancel()
def test_depends_complete_advance(self):
# If we make B depend on A, and then move A through several

0 comments on commit be8e584

Please sign in to comment.
Something went wrong with that request. Please try again.