MCPcopy Create free account
hub / github.com/ehForwarderBot/ehForwarderBot / test_instance_id

Function test_instance_id

tests/test_channel_loading.py:21–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19
20
21def test_instance_id():
22 with tempfile.TemporaryDirectory() as f:
23 os.environ['EFB_DATA_PATH'] = f
24
25 master_id = "tests.mocks.master.MockMasterChannel#instance1"
26 slave_ids = [
27 "tests.mocks.slave.MockSlaveChannel#instance1",
28 "tests.mocks.slave.MockSlaveChannel#instance2"
29 ]
30
31 config = {
32 "master_channel": master_id,
33 "slave_channels": slave_ids
34 }
35 config = dump_and_load_config(config)
36 ehforwarderbot.__main__.init(config)
37
38 assert coordinator.master.channel_id == master_id
39 assert isinstance(coordinator.master, master.MockMasterChannel)
40 for i in slave_ids:
41 assert i in coordinator.slaves
42 assert isinstance(coordinator.slaves[i], slave.MockSlaveChannel)
43
44
45def dump_and_load_config(config):

Callers

nothing calls this directly

Calls 1

dump_and_load_configFunction · 0.85

Tested by

no test coverage detected