From 264e42f24d0c45057722e61438aae8bb37e7b2fa Mon Sep 17 00:00:00 2001 From: Irina Peshinskaya Date: Wed, 23 Nov 2016 16:09:49 +0200 Subject: [PATCH] TT#7029 Clear test data more accurate in some collections Change-Id: If645b91099eadd2c4f85ca63983c9f70fd92bfdf --- t/api-rest/api-peeringservers.t | 3 ++- t/api-rest/api-preferences.t | 4 +++- t/api-rest/api-subscribers.t | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/t/api-rest/api-peeringservers.t b/t/api-rest/api-peeringservers.t index ef2921a7d0..2b9eb955ea 100644 --- a/t/api-rest/api-peeringservers.t +++ b/t/api-rest/api-peeringservers.t @@ -49,6 +49,7 @@ $test_machine->check_get2put(); $test_machine->check_bundle(); $test_machine->clear_test_data_all(); +undef $test_machine; +undef $fake_data; done_testing; - # vim: set tabstop=4 expandtab: diff --git a/t/api-rest/api-preferences.t b/t/api-rest/api-preferences.t index c7a4fc8467..f7feaf3dc5 100644 --- a/t/api-rest/api-preferences.t +++ b/t/api-rest/api-preferences.t @@ -97,9 +97,11 @@ foreach my $api (@apis){ (undef, $preferences_put->{content}) = $test_machine->request_put($preferences_old,$preferences->{uri}); } +$test_machine->clear_test_data_all(); +undef $fake_data; +undef $test_machine; done_testing; - #----------------- aux sub get_preference_existen_value{ my $preference = shift; diff --git a/t/api-rest/api-subscribers.t b/t/api-rest/api-subscribers.t index 38b6ad7c5a..c13f1ac3b3 100644 --- a/t/api-rest/api-subscribers.t +++ b/t/api-rest/api-subscribers.t @@ -52,7 +52,7 @@ $fake_data->set_data_from_script({ 'create_special'=> sub { my ($self,$collection_name,$test_machine) = @_; my $pilot = $test_machine->get_item_hal('subscribers','/api/subscribers/?customer_id='.$self->data->{$collection_name}->{data}->{customer_id}.'&'.'is_pbx_pilot=1'); - if($pilot->{content}->{total_count} <= 0){ + if($pilot->{total_count} <= 0){ undef $pilot; } $test_machine->check_create_correct(1, sub{$_[0]->{is_pbx_pilot} = ($pilot || $_[1]->{i} > 1)? 0 : 1;} ); @@ -242,7 +242,11 @@ if($remote_config->{config}->{features}->{cloudpbx}){ $test_machine->clear_test_data_all();#fake data aren't registered in this test machine, so they will stay. } } +$fake_data->clear_test_data_all(); $test_machine->clear_test_data_all();#fake data aren't registered in this test machine, so they will stay. +$fake_data->clear_test_data_all(); +undef $test_machine; +undef $fake_data; done_testing; sub number_as_string{