perl-Test-LWP-UserAgent-0.033-alt1.noarch.rpm


Advertisement

Description

perl-Test-LWP-UserAgent - a LWP::UserAgent suitable for simulating and testing network calls

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package name perl-Test-LWP-UserAgent
Package version 0.033
Package release alt1
Package architecture noarch
Package type rpm
Installed size 41.01 KB
Download size 41.01 KB
Official Mirror ftp.altlinux.org
This module is a subclass of the LWP::UserAgent manpage 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 classic 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 do not normally arise 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 the PSGI manpage app to handle the requests - see examples/call_psgi.t
in this dist, and also the register_psgi entry elsewhere in this document 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',
);

Alternatives

Package Version Architecture Repository
perl-Test-LWP-UserAgent - - -

Requires

Name Value
/usr/share/perl5 -
perl(HTTP/Date.pm) -
perl(HTTP/Request.pm) -
perl(HTTP/Response.pm) -
perl(HTTP/Status.pm) -
perl(LWP/UserAgent.pm) -
perl(Safe/Isa.pm) -
perl(Scalar/Util.pm) -
perl(Storable.pm) -
perl(Try/Tiny.pm) -
perl(URI.pm) >= 1.620
perl(namespace/clean.pm) >= 0.190
perl(parent.pm) -
rpmlib(PayloadIsLzma) -

Provides

Name Value
perl(Test/LWP/UserAgent.pm) = 0.033
perl-Test-LWP-UserAgent = 0.033-alt1

Download

Type URL
Binary Package perl-Test-LWP-UserAgent-0.033-alt1.noarch.rpm
Source Package perl-Test-LWP-UserAgent-0.033-alt1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-Test-LWP-UserAgent rpm package:
    # sudo apt-get install perl-Test-LWP-UserAgent

Files

Path
/usr/share/doc/perl-Test-LWP-UserAgent-0.033/Changes
/usr/share/doc/perl-Test-LWP-UserAgent-0.033/README
/usr/share/doc/perl-Test-LWP-UserAgent-0.033/docs/advent_2012.pod
/usr/share/doc/perl-Test-LWP-UserAgent-0.033/examples/advent_2012_1.pl
/usr/share/doc/perl-Test-LWP-UserAgent-0.033/examples/advent_2012_2.pl
/usr/share/doc/perl-Test-LWP-UserAgent-0.033/examples/advent_2012_3.pl
/usr/share/doc/perl-Test-LWP-UserAgent-0.033/examples/application_client_test.t
/usr/share/doc/perl-Test-LWP-UserAgent-0.033/examples/call_psgi.t
/usr/share/doc/perl-Test-LWP-UserAgent-0.033/examples/myapp.psgi
/usr/share/doc/perl-Test-LWP-UserAgent-0.033/examples/MyApp/Client.pm
/usr/share/perl5/Test/
/usr/share/perl5/Test/LWP/UserAgent.pm

See Also

Package Description
perl-Test-LatestPrereqs-0.02-alt1.noarch.rpm test if the required module versions are big enough
perl-Test-LatestPrereqs-scripts-0.02-alt1.noarch.rpm Test-LatestPrereqs scripts
perl-Test-Lazy-0.061-alt1.noarch.rpm A quick and easy way to compose and run tests with useful output
perl-Test-Leaner-0.05-alt1.noarch.rpm A slimmer Test::More for when you favor performance over completeness
perl-Test-Legacy-1.2502-alt1.noarch.rpm perl module Test-Legacy
perl-Test-Legal-0.10-alt1.noarch.rpm Test and (optionally) fix copyright notices, LICENSE file, and relevant field of META file
perl-Test-Legal-scripts-0.10-alt1.noarch.rpm Test-Legal scripts
perl-Test-Less-0.11-alt1.noarch.rpm Test Categorization and Subset Execution
perl-Test-Less-scripts-0.11-alt1.noarch.rpm perl-Test-Less scripts
perl-Test-Lib-0.002-alt2_5.noarch.rpm Use libraries from a t/lib directory
perl-Test-LimitDecimalPlaces-0.01-alt1.noarch.rpm Compare numerical values by limiting number of decimal places
perl-Test-Lite-0.009-alt2_10.noarch.rpm A small Perl Test Library
perl-Test-Litmus-0.03-alt1.noarch.rpm perl module Test-Litmus
perl-Test-Lives-1.002-alt1.noarch.rpm the 1UP approach to testing exceptional code
perl-Test-LoadAllModules-0.022-alt1.noarch.rpm do use_ok for modules in search path
Advertisement
Advertisement