def test_update(self): config = LoggingConfiguration() config.clear() now = datetime.utcnow() result = config.master_contacted(update=True, announcement=False) self.assertDateAlmostEqual(now, result) self.assertIs(result, config["last_master_contact"])
def test_update_default(self): config = LoggingConfiguration() config.clear() now = datetime.utcnow() result = config.master_contacted() self.assertDateAlmostEqual(now, result) self.assertIs(result, config["last_master_contact"]) self.assertNotIn("last_announce", config)
def test_announce(self): config = LoggingConfiguration() config.clear() now = datetime.utcnow() config.master_contacted(announcement=True) self.assertDateAlmostEqual(now, config["last_announce"])
def test_no_update(self): config = LoggingConfiguration() config.clear() self.assertIsNone(config.master_contacted(update=False)) self.assertNotIn("last_announce", config) self.assertNotIn("last_master_contact", config)