Revision f23db633 test/ganeti.jqueue_unittest.py

b/test/ganeti.jqueue_unittest.py
449 449
    self._before_start = before_start
450 450
    self._after_start = after_start
451 451

  
452
  def __call__(self, op, cbs, timeout=None):
452
  def __call__(self, op, cbs, timeout=None, priority=None):
453 453
    assert isinstance(op, opcodes.OpTestDummy)
454 454

  
455 455
    if self._before_start:
456
      self._before_start(timeout)
456
      self._before_start(timeout, priority)
457 457

  
458 458
    cbs.NotifyStart()
459 459

  
......
506 506
      # Create job
507 507
      job = self._CreateJob(queue, job_id, ops)
508 508

  
509
      def _BeforeStart(_):
509
      def _BeforeStart(timeout, priority):
510 510
        self.assertFalse(queue.IsAcquired())
511 511
        self.assertEqual(job.CalcStatus(), constants.JOB_STATUS_WAITLOCK)
512 512

  
......
660 660

  
661 661
    self.assertEqual(job.CalcStatus(), constants.JOB_STATUS_QUEUED)
662 662

  
663
    def _BeforeStart(_):
663
    def _BeforeStart(timeout, priority):
664 664
      self.assertFalse(queue.IsAcquired())
665 665
      self.assertEqual(job.CalcStatus(), constants.JOB_STATUS_WAITLOCK)
666 666

  
......
849 849
    # Create job
850 850
    job = self._CreateJob(queue, 29386, ops)
851 851

  
852
    def _BeforeStart(_):
852
    def _BeforeStart(timeout, priority):
853 853
      self.assertFalse(queue.IsAcquired())
854 854
      self.assertEqual(job.CalcStatus(), constants.JOB_STATUS_WAITLOCK)
855 855

  
......
955 955
    self.gave_lock = None
956 956
    self.done_lock_before_blocking = False
957 957

  
958
  def _BeforeStart(self, timeout):
958
  def _BeforeStart(self, timeout, priority):
959 959
    job = self.job
960 960

  
961 961
    self.assertFalse(self.queue.IsAcquired())
......
965 965

  
966 966
    self.assert_(timeout is None or isinstance(timeout, (int, float)))
967 967
    self.assertEqual(timeout, ts.last_timeout)
968
    self.assertEqual(priority, job.ops[self.curop].priority)
968 969

  
969 970
    self.gave_lock = True
970 971

  

Also available in: Unified diff