def METHOD_NAME(mocker, cobbler_api):
    # Arrange
    mock_builtins_open = mocker.patch("builtins.open", mocker.mock_open())
    mock_system = System(cobbler_api)
    mock_system.name = "test_manager_regen_hosts_system"
    mock_system.interfaces = {"default": NetworkInterface(cobbler_api)}
    mock_system.interfaces["default"].dns_name = "host.example.org"
    mock_system.interfaces["default"].mac_address = "AA:BB:CC:DD:EE:FF"
    mock_system.interfaces["default"].ip_address = "192.168.1.2"
    mock_system.interfaces["default"].ipv6_address = "::1"
    dnsmasq.MANAGER = None
    test_manager = dnsmasq.get_manager(cobbler_api)
    test_manager.systems = [mock_system]
    # Act
    test_manager.regen_hosts()
    # Assert
    mock_builtins_open.assert_called_once_with(
        "/var/lib/cobbler/cobbler_hosts", "w+", encoding="UTF-8"
    )
    write_handle = mock_builtins_open()
    write_handle.write.assert_called_once_with("::1\thost.example.org\n")