示例#1
0
 def test_needs_bootstrap_window(self):
     before_now = datetime.utcnow() - timedelta(microseconds=1)
     pillow = ConfigurableIndicatorPillow()
     pillow.bootstrap([])
     pillow.last_bootstrapped = before_now - timedelta(seconds=REBUILD_CHECK_INTERVAL - 5)
     self.assertFalse(pillow.needs_bootstrap())
     pillow.last_bootstrapped = before_now - timedelta(seconds=REBUILD_CHECK_INTERVAL)
     self.assertTrue(pillow.needs_bootstrap())
示例#2
0
 def test_needs_bootstrap_window(self):
     before_now = datetime.utcnow() - timedelta(microseconds=1)
     pillow = ConfigurableIndicatorPillow()
     pillow.bootstrap([])
     pillow.last_bootstrapped = before_now - timedelta(
         seconds=REBUILD_CHECK_INTERVAL - 5)
     self.assertFalse(pillow.needs_bootstrap())
     pillow.last_bootstrapped = before_now - timedelta(
         seconds=REBUILD_CHECK_INTERVAL)
     self.assertTrue(pillow.needs_bootstrap())
示例#3
0
 def test_bootstrap_sets_time(self):
     before_now = datetime.utcnow() - timedelta(microseconds=1)
     pillow = ConfigurableIndicatorPillow()
     pillow.bootstrap([])
     after_now = datetime.utcnow() + timedelta(microseconds=1)
     self.assertTrue(pillow.bootstrapped)
     self.assertTrue(before_now < pillow.last_bootstrapped)
     self.assertTrue(after_now > pillow.last_bootstrapped)
     self.assertFalse(pillow.needs_bootstrap())
示例#4
0
 def test_bootstrap_sets_time(self):
     before_now = datetime.utcnow() - timedelta(microseconds=1)
     pillow = ConfigurableIndicatorPillow()
     pillow.bootstrap([])
     after_now = datetime.utcnow() + timedelta(microseconds=1)
     self.assertTrue(pillow.bootstrapped)
     self.assertTrue(before_now < pillow.last_bootstrapped)
     self.assertTrue(after_now > pillow.last_bootstrapped)
     self.assertFalse(pillow.needs_bootstrap())
示例#5
0
 def test_needs_bootstrap_on_initialization(self):
     pillow = ConfigurableIndicatorPillow()
     self.assertTrue(pillow.needs_bootstrap())
示例#6
0
 def test_needs_bootstrap_on_initialization(self):
     pillow = ConfigurableIndicatorPillow()
     self.assertTrue(pillow.needs_bootstrap())