()
| 19 | |
| 20 | |
| 21 | def 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 | |
| 45 | def dump_and_load_config(config): |
nothing calls this directly
no test coverage detected