| 1 | class TestStatus: |
| 2 | def test_status_leader(self, consul_obj) -> None: |
| 3 | c, _consul_version = consul_obj |
| 4 | |
| 5 | agent_self = c.agent.self() |
| 6 | leader = c.status.leader() |
| 7 | addr_port = agent_self["Stats"]["consul"]["leader_addr"] |
| 8 | |
| 9 | assert leader == addr_port, f"Leader value was {leader}, expected value was {addr_port}" |
| 10 | |
| 11 | def test_status_peers(self, consul_obj) -> None: |
| 12 | c, _consul_version = consul_obj |
| 13 | |
| 14 | agent_self = c.agent.self() |
| 15 | |
| 16 | addr_port = agent_self["Stats"]["consul"]["leader_addr"] |
| 17 | peers = c.status.peers() |
| 18 | |
| 19 | assert addr_port in peers, f"Expected value '{addr_port}' in peer list but it was not present" |