Name : perl-Test-LWP-UserAgent
| |
Version : 0.033
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp151.15.1
| Date : 2018-12-03 21:42:37
|
Group : Development/Libraries/Perl
| Source RPM : perl-Test-LWP-UserAgent-0.033-lp151.15.1.src.rpm
|
Size : 0.07 MB
| |
Packager : (none)
| |
Summary : LWP::UserAgent suitable for simulating and testing network calls
|
Description :
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 client networking 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\', );
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl/openSUSE_Leap_15.1/noarch |
Hmm ... It's impossible ;-) This RPM doesn't exist on any FTP server
Provides :
perl(Test::LWP::UserAgent)
perl-Test-LWP-UserAgent
Requires :