Esempio n. 1
0
 def test_log_status(self):
     poller = haplib.BasePoller(sender=self.sender, process_id="test")
     log_time = testutils.get_priv_attr(poller, "__next_log_status_time")
     poller.log_status(haplib.ArmInfo())
     # check if the next time is update
     new_time = testutils.get_priv_attr(poller, "__next_log_status_time")
     self.assertGreater(new_time, log_time)
     # call again soon. __new_log_status_time should not be updated.
     new_time2 = testutils.get_priv_attr(poller, "__next_log_status_time")
     self.assertEquals(new_time2, new_time)
Esempio n. 2
0
 def setUpClass(cls):
     transporter_args = {"class": transporter.Transporter}
     cls.sender = haplib.Sender(transporter_args)
     cls.poller = haplib.BasePoller(sender=cls.sender, process_id="test")