view release on metacpan or search on metacpan
t/001-file.t view on Meta::CPAN
use_ok('CatalystX::CRUD::Model::File');
use_ok('CatalystX::CRUD::Object::File');
use Catalyst::Test 'MyApp';
use Data::Dump qw( dump );
use HTTP::Request::Common;
use JSON;
####################################################
# basic CRUD
sub json_PUT {
my ( $url, $body, $headers ) = @_;
my $req = HTTP::Request->new( PUT => $url );
$req->headers($headers) if $headers;
$req->header( 'Content-Type' => 'application/json' );
$req->header( 'Content-Length' => length($body) );
$req->content($body);
$req;
t/001-file.t view on Meta::CPAN
{ content => "hello world", file => "testfile" },
"PUT new file response"
);
# read the file we just created
ok( $res = request( HTTP::Request->new( GET => '/rest/file/testfile' ) ),
"GET new file" );
#diag( $res->content );
is_deeply(
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-rdbo.t view on Meta::CPAN
}
use lib qw( t/lib );
use Catalyst::Test 'MyApp';
use Data::Dump qw( dump );
use HTTP::Request::Common;
diag( "testing against Catalyst-Runtime version "
. $Catalyst::Runtime::VERSION );
ok( my $res = request('/foo/test'), "get /foo/test" );
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-dbic.t view on Meta::CPAN
system("cd t/ && $^X insertdb.pl") and die "can't create db: $!";
require Catalyst::Test;
Catalyst::Test->import('MyApp');
use Data::Dump qw( dump );
use HTTP::Request::Common;
ok( my $res = request('/test1'), "get /test1" );
is( $res->content, 13, "right number of results" );
ok( $res = request('/crud/test2?cd.title=Bad'), "get /test2" );
is( $res->content, 3, "iterator for cd.title=Bad" );
t/01-dbic.t view on Meta::CPAN
is( $res->content, 3, "search for cd.title=Bad" );
ok( $res = request('/crud/test4?cd.title=Bad'), "get /test4" );
is( $res->content, 3, "count for cd.title=Bad" );
# read
ok( $res = request( HTTP::Request->new( GET => '/crud/1/view' ) ),
"GET view" );
#diag( $res->content );
is_deeply(
eval $res->content,
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-rdbo.t view on Meta::CPAN
# require to defer till skip checks
require Catalyst::Test;
Catalyst::Test->import('MyRDBO');
use HTTP::Request::Common;
use Data::Dump qw( dump );
use JSON::XS;
#dump MyRDBO::Controller::CRUD::Test::Foo->config;
view all matches for this distribution
view release on metacpan or search on metacpan
"Catalyst::Controller::JMS" : "0",
"Catalyst::Plugin::ConfigLoader" : "0",
"Catalyst::Test" : "0",
"Config::General" : "0",
"Data::Printer" : "0",
"HTTP::Request::Common" : "0",
"Moose" : "2.0801",
"MooseX::MethodAttributes::Role" : "0",
"Net::Stomp::Frame" : "0",
"Test::Fatal" : "0",
"Test::Most" : "0",
view all matches for this distribution
view release on metacpan or search on metacpan
'CatalystX::Controller::ExtJS::REST' => '0',
'DBIx::Class' => '0',
'DBIx::Class::Schema' => '0',
'File::Find' => '0',
'File::Temp' => '0',
'HTTP::Request::Common' => '0',
'JSON' => '0',
'Module::Build' => '0.3601',
'Path::Class::File' => '0',
'Spreadsheet::ParseExcel' => '0',
'Test::More' => '0.88',
view all matches for this distribution
view release on metacpan or search on metacpan
"Catalyst::Controller" => 0,
"Catalyst::Log" => 0,
"Catalyst::ScriptRunner" => 0,
"Catalyst::Test" => 0,
"FindBin" => 0,
"HTTP::Request::Common" => 0,
"Moose" => 0,
"Test::More" => 0,
"Test::Pod" => "1.14",
"Test::Pod::Coverage" => "1.04",
"Test::WWW::Mechanize::Catalyst" => 0,
"Catalyst::Controller" => 0,
"Catalyst::Log" => 0,
"Catalyst::ScriptRunner" => 0,
"Catalyst::Test" => 0,
"FindBin" => 0,
"HTTP::Request::Common" => 0,
"Module::Build" => "0.28",
"Moose" => 0,
"Test::More" => 0,
"Test::Pod" => "1.14",
"Test::Pod::Coverage" => "1.04",
view all matches for this distribution
view release on metacpan or search on metacpan
t/061_signature_matching.t view on Meta::CPAN
use FindBin;
use lib "$FindBin::Bin/lib";
use Test::More;
use Catalyst::Test 'TestApp';
use HTTP::Request::Common;
is get('/sigmatch/test/23'), 'signaturematching/int', 'integer argument dispatched correctly';
is get('/sigmatch/test/foo'), 'signaturematching/str', 'string argument dispatched correctly';
is get('/sigmatch/test/f00'), 'signaturematching/rest', 'no match leads to other dispatched action';
view all matches for this distribution
view release on metacpan or search on metacpan
use Test::More;
use strict;
use warnings;
use HTTP::Request::Common;
use JSON::XS qw(decode_json);
use lib qw(t/lib);
use Test::WWW::Mechanize::Catalyst 'MyApp';
view all matches for this distribution
view release on metacpan or search on metacpan
benchmark/rest.pl view on Meta::CPAN
use strict;
use warnings;
BEGIN { $ENV{CATALYST_DEBUG} = 0; $ENV{DBIC_TRACE} = 0;};
use HTTP::Request::Common;
use JSON;
use lib qw(t/lib);
use Test::WWW::Mechanize::Catalyst 'MyApp';
view all matches for this distribution
view release on metacpan or search on metacpan
Catalyst::Plugin::Session::State::Cookie: 0
Catalyst::Plugin::Session::Store::FastMmap: 0
Catalyst::Test: 0
ExtUtils::MakeMaker: 6.42
FindBin: 0
HTTP::Request: 0
Test::More: 0.62
Test::WWW::Mechanize::Catalyst: 0
configure_requires:
ExtUtils::MakeMaker: 6.42
distribution_type: module
view all matches for this distribution
view release on metacpan or search on metacpan
t/live-test.t view on Meta::CPAN
# setup library path
use FindBin qw($Bin);
use lib "$Bin/lib";
use HTTP::Headers;
use HTTP::Request::Common;
use LWP::Simple qw(!get);
use JSON::Any;
# make sure testapp works
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Authentication/Credential/OAuth2.pm view on Meta::CPAN
package Catalyst::Authentication::Credential::OAuth2;
use Moose;
use MooseX::Types::Common::String qw(NonEmptySimpleStr);
use LWP::UserAgent;
use HTTP::Request::Common;
use JSON::Any;
use Moose::Util;
# ABSTRACT: Authenticate against OAuth2 servers
view all matches for this distribution
view release on metacpan or search on metacpan
abstract: 'Map body and data parameters to a model'
author:
- 'John Napiorkowski <jjnapiork@cpan.org>'
build_requires:
Catalyst::Test: '0'
HTTP::Request::Common: '0'
Test::Lib: '0.003'
Test::Most: '0.34'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
view all matches for this distribution
view release on metacpan or search on metacpan
t/02_crud.t view on Meta::CPAN
#!/usr/bin/env perl
use FindBin qw/$Bin/;
use lib "$Bin/lib";
use CatalystX::Resource::TestKit;
use Test::Exception;
use HTTP::Request::Common;
use Catalyst::Test qw/TestApp/;
my ($res, $c) = ctx_request('/');
my $schema = $c->model('DB')->schema;
view all matches for this distribution
view release on metacpan or search on metacpan
use Test::More 0.88;
use lib 't/lib';
use Catalyst::Test 'MyApp1';
use HTTP::Request::Common qw( GET PUT POST DELETE );
{
request( GET '/foo', ( Accept => 'application/json' ) );
is(
view all matches for this distribution
view release on metacpan or search on metacpan
Catalyst::Plugin::Session::State::Cookie: 0
CatalystX::InjectComponent: 0
Class::Load: '0.20'
ExtUtils::MakeMaker: 6.36
File::Temp: 0
HTTP::Request::Common: 0
SQL::Translator: 0
Test::Exception: 0
Test::More: '0.94'
configure_requires:
ExtUtils::MakeMaker: 6.36
view all matches for this distribution
view release on metacpan or search on metacpan
},
"test" : {
"requires" : {
"Catalyst::Runtime" : "5.80",
"FindBin" : 0,
"HTTP::Request::Common" : 0,
"Moose" : "2.0007",
"Test::More" : "0.98",
"namespace::autoclean" : "0.12",
"syntax" : "0.003"
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CatalystX/Test/MockContext.pm view on Meta::CPAN
version 0.000004
=head1 SYNOPSIS
use HTTP::Request::Common;
use CatalystX::Test::MockContext;
my $m = mock_context('MyApp');
my $c = $m->(GET '/');
lib/CatalystX/Test/MockContext.pm view on Meta::CPAN
=head2 mock_context
my $sub = mock_context('MyApp');
This function returns a closure that takes an L<HTTP::Request> object and returns a
L<Catalyst> context object for that request.
=head1 SOURCE
The development version is on github at L<https://github.com/robrwo/CatalystX-Test-MockContext>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CatalystX/Test/Most.pm view on Meta::CPAN
package CatalystX::Test::Most;
use strictures;
no warnings "uninitialized";
use HTTP::Request::Common ( qw{ GET POST DELETE PUT } );
use Test::More;
use Test::Fatal;
our $AUTHORITY = "cpan:ASHLEY";
our $VERSION = "0.05";
our @EXPORT = ( qw{ GET POST DELETE PUT },
lib/CatalystX/Test/Most.pm view on Meta::CPAN
*{"${calling_package}::$_"} = \&{$_} for @EXPORT;
}
}
# delete is obviously a problem and the rest should maybe be the uc
# anyway and not export the HTTP::Request::Common ones or something new?
#sub get { request( GET( @_ ) ); }
#sub put { request( PUT( @_ ) ); }
#sub post { request( POST( @_ ) ); }
#sub delete { request( DELETE( @_ ) ); }
lib/CatalystX/Test/Most.pm view on Meta::CPAN
=pod
=head1 Name
CatalystX::Test::Most - Test base pulling in L<Catalyst::Test>, L<Test::More>, L<Test::Fatal>, and L<HTTP::Request::Common> for unit tests on Catalyst applications.
=head1 Synopsis
use CatalystX::Test::Most "MyApp";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CatalystX/Test/Recorder.pm view on Meta::CPAN
use Test::More;
use strict;
use warnings;
use URI;
use HTTP::Request::Common qw(GET HEAD PUT DELETE POST);
use Test::WWW::Mechanize::Catalyst 'MyApp';
my $mech = Test::WWW::Mechanize::Catalyst->new();
$mech->requests_redirectable([]); # disallow redirects
view all matches for this distribution
view release on metacpan or search on metacpan
cpanfile.snapshot view on Meta::CPAN
HTTP::Daemon 6.01
HTTP::Daemon::ClientConn 6.01
requirements:
ExtUtils::MakeMaker 0
HTTP::Date 6
HTTP::Request 6
HTTP::Response 6
HTTP::Status 6
IO::Socket 0
LWP::MediaTypes 6
Sys::Hostname 0
cpanfile.snapshot view on Meta::CPAN
HTTP::Headers 6.05
HTTP::Headers::Auth 6.00
HTTP::Headers::ETag 6.00
HTTP::Headers::Util 6.03
HTTP::Message 6.06
HTTP::Request 6.00
HTTP::Request::Common 6.04
HTTP::Response 6.04
HTTP::Status 6.03
requirements:
Compress::Raw::Zlib 0
Encode 2.21
cpanfile.snapshot view on Meta::CPAN
HTML::HeadParser 0
HTTP::Cookies 6
HTTP::Daemon 6
HTTP::Date 6
HTTP::Negotiate 6
HTTP::Request 6
HTTP::Request::Common 6
HTTP::Response 6
HTTP::Status 6
IO::Select 0
IO::Socket 0
LWP::MediaTypes 6
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catmandu/CA/API/Login.pm view on Meta::CPAN
use Catmandu::Sane;
use Data::Dumper qw(Dumper);
use LWP::UserAgent;
use HTTP::Request::Common;
use JSON;
has username => (is => 'ro', required => 1);
has password => (is => 'ro', required => 1);
has url => (is => 'ro', required => 1);
view all matches for this distribution
view release on metacpan or search on metacpan
cpanfile.snapshot view on Meta::CPAN
requirements:
Carp 0
ExtUtils::MakeMaker 0
HTTP::Date 6
HTTP::Headers::Util 6
HTTP::Request 0
Time::Local 0
locale 0
perl 5.008001
strict 0
vars 0
cpanfile.snapshot view on Meta::CPAN
HTTP::Daemon 6.01
HTTP::Daemon::ClientConn 6.01
requirements:
ExtUtils::MakeMaker 0
HTTP::Date 6
HTTP::Request 6
HTTP::Response 6
HTTP::Status 6
IO::Socket 0
LWP::MediaTypes 6
Sys::Hostname 0
cpanfile.snapshot view on Meta::CPAN
HTTP::Headers 6.13
HTTP::Headers::Auth 6.13
HTTP::Headers::ETag 6.13
HTTP::Headers::Util 6.13
HTTP::Message 6.13
HTTP::Request 6.13
HTTP::Request::Common 6.13
HTTP::Response 6.13
HTTP::Status 6.13
requirements:
Carp 0
Compress::Raw::Zlib 0
cpanfile.snapshot view on Meta::CPAN
HTML::HeadParser 0
HTTP::Cookies 6
HTTP::Daemon 6
HTTP::Date 6
HTTP::Negotiate 6
HTTP::Request 6
HTTP::Request::Common 6
HTTP::Response 6
HTTP::Status 6
IO::Select 0
IO::Socket 0
LWP::MediaTypes 6
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catmandu/FedoraCommons.pm view on Meta::CPAN
use Catmandu::FedoraCommons::Response;
our $VERSION = '0.274';
use URI::Escape;
use HTTP::Request::Common qw(GET POST DELETE PUT HEAD);
use LWP::UserAgent;
use MIME::Base64;
use strict;
use Carp;
use Data::Validate::URI qw(is_uri);
view all matches for this distribution
view release on metacpan or search on metacpan
cpanfile.snapshot view on Meta::CPAN
HTTP::Daemon 6.01
HTTP::Daemon::ClientConn 6.01
requirements:
ExtUtils::MakeMaker 0
HTTP::Date 6
HTTP::Request 6
HTTP::Response 6
HTTP::Status 6
IO::Socket 0
LWP::MediaTypes 6
Sys::Hostname 0
cpanfile.snapshot view on Meta::CPAN
HTTP::Headers 6.11
HTTP::Headers::Auth 6.11
HTTP::Headers::ETag 6.11
HTTP::Headers::Util 6.11
HTTP::Message 6.11
HTTP::Request 6.11
HTTP::Request::Common 6.11
HTTP::Response 6.11
HTTP::Status 6.11
requirements:
Compress::Raw::Zlib 0
Encode 2.21
cpanfile.snapshot view on Meta::CPAN
HTML::HeadParser 0
HTTP::Cookies 6
HTTP::Daemon 6
HTTP::Date 6
HTTP::Negotiate 6
HTTP::Request 6
HTTP::Request::Common 6
HTTP::Response 6
HTTP::Status 6
IO::Select 0
IO::Socket 0
LWP::MediaTypes 6
view all matches for this distribution
view release on metacpan or search on metacpan
cpanfile.snapshot view on Meta::CPAN
HTTP::Daemon 6.01
HTTP::Daemon::ClientConn 6.01
requirements:
ExtUtils::MakeMaker 0
HTTP::Date 6
HTTP::Request 6
HTTP::Response 6
HTTP::Status 6
IO::Socket 0
LWP::MediaTypes 6
Sys::Hostname 0
cpanfile.snapshot view on Meta::CPAN
HTTP::Headers 6.11
HTTP::Headers::Auth 6.11
HTTP::Headers::ETag 6.11
HTTP::Headers::Util 6.11
HTTP::Message 6.11
HTTP::Request 6.11
HTTP::Request::Common 6.11
HTTP::Response 6.11
HTTP::Status 6.11
requirements:
Compress::Raw::Zlib 0
Encode 2.21
cpanfile.snapshot view on Meta::CPAN
HTML::HeadParser 0
HTTP::Cookies 6
HTTP::Daemon 6
HTTP::Date 6
HTTP::Negotiate 6
HTTP::Request 6
HTTP::Request::Common 6
HTTP::Response 6
HTTP::Status 6
IO::Select 0
IO::Socket 0
LWP::MediaTypes 6
view all matches for this distribution
view release on metacpan or search on metacpan
cpanfile.snapshot view on Meta::CPAN
HTTP::Daemon 6.01
HTTP::Daemon::ClientConn 6.01
requirements:
ExtUtils::MakeMaker 0
HTTP::Date 6
HTTP::Request 6
HTTP::Response 6
HTTP::Status 6
IO::Socket 0
LWP::MediaTypes 6
Sys::Hostname 0
cpanfile.snapshot view on Meta::CPAN
HTTP::Headers 6.11
HTTP::Headers::Auth 6.11
HTTP::Headers::ETag 6.11
HTTP::Headers::Util 6.11
HTTP::Message 6.11
HTTP::Request 6.11
HTTP::Request::Common 6.11
HTTP::Response 6.11
HTTP::Status 6.11
requirements:
Compress::Raw::Zlib 0
Encode 2.21
cpanfile.snapshot view on Meta::CPAN
HTML::HeadParser 0
HTTP::Cookies 6
HTTP::Daemon 6
HTTP::Date 6
HTTP::Negotiate 6
HTTP::Request 6
HTTP::Request::Common 6
HTTP::Response 6
HTTP::Status 6
IO::Select 0
IO::Socket 0
LWP::MediaTypes 6
view all matches for this distribution
view release on metacpan or search on metacpan
cpanfile.snapshot view on Meta::CPAN
HTTP::Daemon 6.01
HTTP::Daemon::ClientConn 6.01
requirements:
ExtUtils::MakeMaker 0
HTTP::Date 6
HTTP::Request 6
HTTP::Response 6
HTTP::Status 6
IO::Socket 0
LWP::MediaTypes 6
Sys::Hostname 0
cpanfile.snapshot view on Meta::CPAN
HTTP::Headers 6.11
HTTP::Headers::Auth 6.11
HTTP::Headers::ETag 6.11
HTTP::Headers::Util 6.11
HTTP::Message 6.11
HTTP::Request 6.11
HTTP::Request::Common 6.11
HTTP::Response 6.11
HTTP::Status 6.11
requirements:
Compress::Raw::Zlib 0
Encode 2.21
cpanfile.snapshot view on Meta::CPAN
HTML::HeadParser 0
HTTP::Cookies 6
HTTP::Daemon 6
HTTP::Date 6
HTTP::Negotiate 6
HTTP::Request 6
HTTP::Request::Common 6
HTTP::Response 6
HTTP::Status 6
IO::Select 0
IO::Socket 0
LWP::MediaTypes 6
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catmandu/Importer.pm view on Meta::CPAN
our $VERSION = '1.2025';
use Catmandu::Util qw(io is_value is_string is_array_ref is_hash_ref);
use Catmandu::Util::Path qw(as_path);
use LWP::UserAgent;
use HTTP::Request ();
use URI ();
use URI::Template ();
use Moo::Role;
use namespace::clean;
lib/Catmandu/Importer.pm view on Meta::CPAN
sub _http_request {
my ($self, $method, $url, $headers, $body, $timing_tries) = @_;
my $client = $self->_http_client;
my $req = HTTP::Request->new($method, $url, $headers || []);
$req->content($body) if defined $body;
my $res = $client->request($req);
if ($res->code =~ /^408|500|502|503|504$/ && $timing_tries) {
view all matches for this distribution