def test_host_reachable_on_primary_port(self, mock_check): assert ( check_network.is_host_reachable_from_container( "container", "host", "primary_port", "secondary_port" ) is True ) # only check primary port if reachable assert mock_check.call_count == 1
def test_host_not_reachable_on_either_port(self, mock_check): assert ( check_network.is_host_reachable_from_container( "container", "host", "primary_port", "secondary_port" ) is False ) # check secondary port when not reachable on primary port assert mock_check.call_count == 2