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())
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())
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())
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())
def test_needs_bootstrap_on_initialization(self): pillow = ConfigurableIndicatorPillow() self.assertTrue(pillow.needs_bootstrap())
def test_needs_bootstrap_on_initialization(self): pillow = ConfigurableIndicatorPillow() self.assertTrue(pillow.needs_bootstrap())