Packages / openSUSE Tumbleweed / Source / perl-Test-LWP-UserAgent

Source Package: perl-Test-LWP-UserAgent (0.36.0-1.5)

LWP::UserAgent suitable for simulating and testing network calls

This module is a subclass of LWP::UserAgent which overrides a few key low-level methods that are concerned with actually sending your request over the network, allowing an interception of that request and simulating a particular response. This greatly facilitates testing of networking client code where the server follows a known protocol. The synopsis describes a typical case where you want to test how your application reacts to various responses from the server. This module will let you send back various responses depending on the request, without having to set up a real server to test against. This can be invaluable when you need to test edge cases or error conditions that are not normally returned from the server. There are a lot of different ways you can set up the response mappings, and hook into this module; see the documentation for the individual interface methods. You can use a PSGI app to handle the requests - see _examples/call_psgi.t_ in this distribution, and also register_psgi below. OR, you can route some or all requests through the network as normal, but still gain the hooks provided by this class to test what was sent and received: my $useragent = Test::LWP::UserAgent->new(network_fallback => 1); or: $useragent->map_network_response(qr/real.network.host/); is( $useragent->last_useragent->timeout, 180, 'timeout was overridden properly', ); is( $useragent->last_http_request_sent->uri, 'uri my code should have constructed', ); is( $useragent->last_http_response_received->code, '200', 'I should have gotten an OK response', );

Package information

Homepage
[https://metacpan.org/release/Test-LWP-UserAgent]
License
Artistic-1.0 OR GPL-1.0-or-later
Downstream-Paketbetreuer
Unbekannt: in der indizierten Quelle nicht gemeldet

The following binary packages are built from this source package:

Bekannte Sicherheitslücken

Keine passenden Meldungen in den erfassten Quellen.

Zuletzt synchronisiert:

[CVE-Katalog]

Quellen

  • Authoritative source; repository metadata signature verified

    Signaturnachweis

    tumbleweed-oss-multiarch:4db10cdde3ad82c7e22be35753c9e164b4bdd30f92db4aee17a0d4c94c5f902f

    Repository-signature verification record
    Signed-object SHA-256
    4db10cdde3ad82c7e22be35753c9e164b4bdd30f92db4aee17a0d4c94c5f902f
    Signer fingerprint
    AD485664E901B867051AB15F35A2F86E29B700A4
    Keyring revision
    opensuse-project-signing-key.asc
    SHA-256 b5745739ebfb95b25b8e810f9bcb847fe750ccda598bd85f02f0e974599a6d7e
    Tool and policy
    gpgv (GnuPG) 2.4.9
    openfactory-software-catalog-signature-v1
    Verification time
    Sep 1, 2026
    Repository metadata hash linkage
    Result
    Recorded as verified; digest details unavailable