Bugzilla – Attachment 168142 Details for
Bug 36936
api/v1/bookings.t generates warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36936: Squash warning in bookings test
Bug-36936-Squash-warning-in-bookings-test.patch (text/plain), 1.63 KB, created by
Martin Renvoize (ashimema)
on 2024-06-26 13:14:08 UTC
(
hide
)
Description:
Bug 36936: Squash warning in bookings test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-06-26 13:14:08 UTC
Size:
1.63 KB
patch
obsolete
>From 2999f4267211a35812dd483813925bb1819b3ecf Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 26 Jun 2024 14:12:48 +0100 >Subject: [PATCH] Bug 36936: Squash warning in bookings test > >Simple catch for the warning throwing by DuplicateID exceptions in the >bookings.t api tests. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/api/v1/bookings.t | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/api/v1/bookings.t b/t/db_dependent/api/v1/bookings.t >index 97f2c202611..e616c35d755 100755 >--- a/t/db_dependent/api/v1/bookings.t >+++ b/t/db_dependent/api/v1/bookings.t >@@ -19,6 +19,7 @@ use Modern::Perl; > > use Test::More tests => 5; > use Test::Mojo; >+use Test::Warn; > > use t::lib::TestBuilder; > use t::lib::Mocks; >@@ -189,7 +190,7 @@ subtest 'get() tests' => sub { > > subtest 'add() tests' => sub { > >- plan tests => 15; >+ plan tests => 16; > > $schema->storage->txn_begin; > >@@ -264,8 +265,11 @@ subtest 'add() tests' => sub { > > # Authorized attempt to create with existing id > $booking->{booking_id} = $booking_id; >- $t->post_ok( "//$userid:$password@/api/v1/bookings" => json => $booking )->status_is(409) >- ->json_is( "/error" => "Duplicate booking_id" ); >+ warnings_like { >+ $t->post_ok( "//$userid:$password@/api/v1/bookings" => json => $booking )->status_is(409) >+ ->json_is( "/error" => "Duplicate booking_id" ); >+ } >+ qr/DBD::mysql::st execute failed: Duplicate entry '(.*?)' for key 'PRIMARY'/; > > # TODO: Test bookings clashes > # TODO: Test item auto-assignment >-- >2.45.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36936
:
168142
|
168219
|
169611