TT#79955 Allow rewriting 'unique_id" in API TestFramework

Following "TT#74160 Allow reuse of API TestFramework object",
allow calling the same API TestFramework object with different
'unique_id" value.

Change-Id: I4119361fee64629466668d49244961123c4b72b6
changes/60/39460/1
Victor Tsvetov 6 years ago
parent f5459af67e
commit 52feebeefc

@ -29,7 +29,7 @@ has 'file_path' => (
has 'unique_id' => (
isa => 'Str',
is => 'ro'
is => 'rw'
);
sub run {
@ -77,8 +77,10 @@ sub run {
my $test_executor = NGCP::API::TestFramework::TestExecutor->new();
# If $self->{retained} is already defined, use its previously collected variables.
# Otherwise, initialize it with received "unique_id" for fields that need to be unique.
my $retained = $self->{retained} //= { unique_id => $self->unique_id };
# Otherwise, initialize it.
# In any case, update with received "unique_id" for fields that need to be unique.
my $retained = $self->{retained} //= {};
$retained->{unique_id} = $self->unique_id;
my $test_case_result = { success => 1, error_count => 0 };

Loading…
Cancel
Save