MT#18601 Consider cloudpbx feature configuration in tests

Change-Id: I8c69abcf24779fb93af726294b56bb5c16b06ff6
changes/97/5797/4
Irina Peshinskaya 10 years ago
parent 565cf4870e
commit 9713936cd4

@ -144,7 +144,8 @@ my $remote_config = $test_machine->init_catalyst_config;
}
{
#18601
diag("18601");
diag("18601: config->features->cloudpbx: ".$remote_config->{config}->{features}->{cloudpbx}.";\n");
if($remote_config->{config}->{features}->{cloudpbx}){
my $groups = $test_machine->check_create_correct( 3, sub{
my $num = $_[1]->{i};
$_[0]->{username} .= time().'_18601_'.$num ;
@ -171,17 +172,18 @@ my $remote_config = $test_machine->init_catalyst_config;
$members->[0]->{content}->{pbx_group_ids} = [map { $groups->[$_]->{content}->{id} } (2,1)];
diag("2. Check that member will return groups as they were specified");
#($member_put,$member_get) = $test_machine->check_put2get($members->[0]);
($member_put,$member_get) = $test_machine->check_put2get($members->[0]);
$groups->[1]->{content}->{pbx_groupmember_ids} = [map { $members->[$_]->{content}->{id} } (2,1,0)];
diag("3. Check that group will return members as they were specified");
#my($group_put,$group_get) = $test_machine->check_put2get($groups->[1]);
my($group_put,$group_get) = $test_machine->check_put2get($groups->[1]);
$groups->[1]->{content}->{pbx_groupmember_ids} = [];
diag("4. Check that group will return empty members after put members empty");
my($group_put,$group_get) = $test_machine->check_put2get($groups->[1]);
$test_machine->clear_test_data_all();#fake data aren't registered in this test machine, so they will stay.
}
}
$test_machine->clear_test_data_all();#fake data aren't registered in this test machine, so they will stay.
done_testing;

@ -21,7 +21,7 @@ use Data::Dumper;
has 'local_test' => (
is => 'rw',
isa => 'Str',
default => $ENV{LOCAL_TEST} // '',
default => sub {$ENV{LOCAL_TEST} // ''},
);
has 'DEBUG' => (
@ -53,9 +53,10 @@ has 'ua' => (
has 'base_uri' => (
is => 'ro',
isa => 'Str',
lazy => 1,
default => sub {
$_[0]->{local_test}
? ( length($_[0]->{local_test})>1 ? $_[0]->{local_test} : 'https://127.0.0.1:4443' )
$_[0]->local_test
? ( length($_[0]->local_test)>1 ? $_[0]->local_test : 'https://127.0.0.1:1443' )
: $ENV{CATALYST_SERVER} || ('https://'.hostfqdn.':4443');
},
);
@ -319,11 +320,11 @@ sub get_item_hal{
$uri //= $self->get_uri_collection($name)."?page=1&rows=1";
my($res,$list_collection,$req) = $self->check_item_get($self->normalize_uri($uri));
($reshal,$location) = $self->get_hal_from_collection($list_collection,$name);
#if($reshal->{content}->{total_count}){
if($reshal->{content}->{total_count}){
$resitem = { num => 1, content => $reshal, res => $res, req => $req, location => $location };
$self->DATA_LOADED->{$name} ||= [];
push @{$self->DATA_LOADED->{$name}}, $resitem;
#}
}
}
return $resitem;
}

Loading…
Cancel
Save