def test_load_config_with_callback(self):
		self.touched = False
		self.cbpath = None
		self.cbconfig = None
		event = threading.Event()
		def callback(path, config):
			self.touched = True
			self.cbpath = path
			self.cbconfig = config
			event.set()
		pettingzoo.discovery.write_distributed_config(
			self.connection, 'mysql', 'reports', self.sample, '127.0.0.1')
		ddc = pettingzoo.discovery.DistributedDiscovery(self.connection)
		config = ddc.load_config('mysql', 'reports', callback=callback)
		sample2 = {
			'header': {
				'service_class': 'mysql', 'metadata': {'version': 1.0}
			},
			'username': 'reports',
			'host': 'notlocalhost',
			'port': 3306,
			'password': 'reports',
			'database': 'reports',
			'encoding': 'utf8'
		}
		pettingzoo.discovery.write_distributed_config(
			self.connection, 'mysql', 'reports', sample2, '127.0.0.2')
		event.wait(0.25)
		self.assertTrue(self.touched)
		self.assertEqual(self.cbpath, '/test_discovery/mysql/reports')
		config = self.cbconfig
		self.assertTrue(['localhost', 'notlocalhost'] in config['host'])
		mismatch_keys = [
			key for key in self.sample
				if not key in config or self.sample[key] != config[key]]
		for key in mismatch_keys:
			self.assertTrue(key in ['host', 'header'])
dataset/ETHPy150Open Knewton/pettingzoo-python/pettingzoo/tests/test_discovery.py/DistributedDiscoveryTests.test_load_config_with_callback/swapped operands of `in`