def add_unique_id(logger_class, log_method, event): ''' Attach a unique id per event ''' event['id'] = utils.generate_unique_id() return event
def add_unique_id(logger_class, log_method, event): """ Attach a unique id per event """ event["id"] = utils.generate_unique_id() return event
def test_id_generator_unicity(self): new_id = utils.generate_unique_id() for _ in range(self.random_length): old_id = new_id new_id = utils.generate_unique_id() self.assertTrue(new_id != old_id)
def test_id_generator(self): new_id = utils.generate_unique_id() self.assertTrue(isinstance(new_id, str)) self.assertTrue(len(new_id) == 36)