def test_topology_hostname(): mysql_check = MySql(common.CHECK_NAME, {}, {}) assert mysql_check._get_topology_hostname( "localhost", common.PORT) == "stubbed.hostname" assert mysql_check._get_topology_hostname("myhost", 0) == "stubbed.hostname" assert mysql_check._get_topology_hostname("myhost", common.PORT) == "myhost"
def test_topology(topology, instance_basic): mysql_check = MySql(common.CHECK_NAME, {}, {}) mysql_check.check(instance_basic) topology.assert_snapshot(mysql_check.check_id, TopologyInstance("mysql", "mysql://mysql"), components=[{"id": mysql_check._get_topology_hostname(common.HOST, common.PORT), "type": "mysql", "data": {}}])