def test_queue_safe_remove_not_existing(self): q = MultiLockPriorityPoolQueue() t = Task("test_task", [1, 2, 3], "pool", [], {}) assert len(q._locks) == 0 with pytest.raises(LookupError): q.safe_remove(str(t.id))
def test_queue_safe_remove_pending(self): q = MultiLockPriorityPoolQueue() t = Task("test_task", [1, 2, 3], "pool", [], {}) q.put(t) assert len(q._locks) == 0 q.safe_remove(str(t.id)) assert len(q._locks) == 0
def test_queue_safe_remove_active(self): q = MultiLockPriorityPoolQueue() t = Task("test_task", [1, 2, 3], "pool", [], {}) q.put(t) q.get("pool") assert len(q._locks) == 3 assert 1 in q._locks assert 2 in q._locks assert 3 in q._locks q.safe_remove(str(t.id)) assert len(q._locks) == 0