App-RPi-EnvUI
view release on metacpan or search on metacpan
t/200-route_load_front_page.t view on Meta::CPAN
use TestBase;
config();
set_testing();
db_create();
}
use Test::More;
use FindBin;
use lib "$FindBin::Bin/../lib";
use HTTP::Request::Common;
use Plack::Test;
use App::RPi::EnvUI;
my $test = Plack::Test->create(App::RPi::EnvUI->to_app);
{
my $res = $test->request(GET '/');
ok $res->is_success, 'Successful request';
like $res->content, qr/Temperature/, 'front page loaded ok';
}
t/205-route_light.t view on Meta::CPAN
use lib 't/';
use TestBase;
config();
set_testing();
db_create();
}
use FindBin;
use lib "$FindBin::Bin/../lib";
use HTTP::Request::Common;
use Plack::Test;
use App::RPi::EnvUI;
my $test = Plack::Test->create(App::RPi::EnvUI->to_app);
{ # /light route
my $res = $test->request(GET '/light');
ok $res->is_success, '/light request ok';
t/210-route_get_config.t view on Meta::CPAN
use lib 't/';
use TestBase;
config();
set_testing();
db_create();
}
use FindBin;
use lib "$FindBin::Bin/../lib";
use HTTP::Request::Common;
use Plack::Test;
use App::RPi::EnvUI;
my $test = Plack::Test->create(App::RPi::EnvUI->to_app);
{
my @directives = qw(
event_fetch_timer event_action_timer event_display_timer
sensor_pin testing time_zone
);
t/210-route_get_control.t view on Meta::CPAN
use lib 't/';
use TestBase;
config();
set_testing();
db_create();
}
use FindBin;
use lib "$FindBin::Bin/../lib";
use HTTP::Request::Common;
use Plack::Test;
use App::RPi::EnvUI;
my $test = Plack::Test->create(App::RPi::EnvUI->to_app);
{
my @directives = qw(
temp_limit humidity_limit temp_aux_on_time humidity_aux_on_time
temp_aux humidity_aux light_aux
);
t/215-route_get_aux.t view on Meta::CPAN
use lib 't/';
use TestBase;
config();
set_testing();
db_create();
}
use FindBin;
use lib "$FindBin::Bin/../lib";
use HTTP::Request::Common;
use Plack::Test;
use App::RPi::EnvUI;
my $test = Plack::Test->create(App::RPi::EnvUI->to_app);
{
my $i = 0;
for (1..8){
my $id = "aux$_";
my $res = $test->request(GET "/get_aux/$id");
t/220-route_fetch_env.t view on Meta::CPAN
use lib 't/';
use TestBase;
config();
set_testing();
db_create();
}
use FindBin;
use lib "$FindBin::Bin/../lib";
use HTTP::Request::Common;
use Plack::Test;
use App::RPi::EnvUI;
my $test = Plack::Test->create(App::RPi::EnvUI->to_app);
{ # /fetch_env route
my $res = $test->request(GET "/fetch_env");
ok $res->is_success, "/fetch_env request ok";
my $j = $res->content;
t/225-route_set_aux.t view on Meta::CPAN
}
use Mock::Sub no_warnings => 1;
my $m = Mock::Sub->new;
my $switch_sub = $m->mock('App::RPi::EnvUI::API::switch');
use FindBin;
use lib "$FindBin::Bin/../lib";
use HTTP::Request::Common;
use Plack::Test;
use App::RPi::EnvUI;
my $test = Plack::Test->create(App::RPi::EnvUI->to_app);
{ # /set_aux_state route
my $p;
# no params
my $res = $test->request( GET "/set_aux_state" );
t/226-route_set_aux_override.t view on Meta::CPAN
use Mock::Sub no_warnings => 1;
#my $m = Mock::Sub->new;
#my $switch_sub = $m->mock('App::RPi::EnvUI::API::switch');
use FindBin;
use lib "$FindBin::Bin/../lib";
use App::RPi::EnvUI::API;
use HTTP::Request::Common;
use Plack::Test;
use App::RPi::EnvUI;
my $api = App::RPi::EnvUI::API->new(testing => 1);
my $test = Plack::Test->create(App::RPi::EnvUI->to_app);
{ # /set_aux_override route
my $p;
# no params
t/300-login_route.t view on Meta::CPAN
use TestBase;
config();
set_testing();
db_create();
}
use Test::More;
use FindBin;
use lib "$FindBin::Bin/../lib";
use HTTP::Request::Common;
use Plack::Test;
use App::RPi::EnvUI;
my $test = Plack::Test->create(App::RPi::EnvUI->to_app);
{
my $res = $test->request(GET '/');
ok $res->is_success, 'Successful request';
like $res->content, qr/Temperature/, 'front page loaded ok';
}
( run in 0.450 second using v1.01-cache-2.11-cpan-de7293f3b23 )