[open-ils-commits] [GIT] Evergreen ILS branch master updated. 697d260e3db01ccbce9862335f380689bef18b77

Evergreen Git git at git.evergreen-ils.org
Tue Jun 20 14:50:47 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  697d260e3db01ccbce9862335f380689bef18b77 (commit)
       via  a7e31470b5e0dfabe04a9808e433fa754f67e8c7 (commit)
      from  876660f25b3778f2bae7933c1ac6eed6df6050fb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 697d260e3db01ccbce9862335f380689bef18b77
Author: Chris Sharp <csharp at georgialibraries.org>
Date:   Wed May 31 08:22:58 2017 -0400

    LP#1694696 - Check for blank SMS Carriers in A/T reactor
    
    Currently, the get_sms_gateway_email subroutine does not check
    for the truthiness of sms_carrier, which can result in catastrophic
    failure for a running server.  This adds that check.
    
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
index 0df0ab0..f334f66 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
@@ -380,7 +380,7 @@ $_TT_helpers = {
         my $sms_carrier = shift;
         my $sms_notify = shift;
 
-        if (! defined $sms_notify || $sms_notify eq '') {
+        if (! defined $sms_notify || $sms_notify eq '' || ! defined $sms_carrier || $sms_carrier eq '') {
             return '';
         }
 

commit a7e31470b5e0dfabe04a9808e433fa754f67e8c7
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Tue Jun 20 14:56:43 2017 -0400

    LP#1694696: add some unit tests for A/T helpers
    
    In particular, start with get_sms_gateway_email().
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/live_t/23-action-trigger-templates.t b/Open-ILS/src/perlmods/live_t/23-action-trigger-templates.t
new file mode 100644
index 0000000..cd71d82
--- /dev/null
+++ b/Open-ILS/src/perlmods/live_t/23-action-trigger-templates.t
@@ -0,0 +1,37 @@
+#!perl
+
+use strict;
+use warnings;
+use Test::More tests => 3;
+use OpenILS::Utils::TestUtils;
+use OpenILS::Const qw(:const);
+
+my $script = OpenILS::Utils::TestUtils->new();
+$script->bootstrap;
+
+use OpenILS::Application::Trigger::Reactor;
+my $r = "OpenILS::Application::Trigger::Reactor";
+
+my $env = {
+    carrier  => 1,
+    number   => '',
+    template => '[%- helpers.get_sms_gateway_email(carrier, number) -%]',
+};
+my $addr = $r->run_TT($env, 1);
+is($addr, '', 'helpers.get_sms_gateway_email: no number means no SMS gateway address');
+
+$env = {
+    carrier  => 1,
+    number   => '9015551212',
+    template => '[%- helpers.get_sms_gateway_email(carrier, number) -%]',
+};
+$addr = $r->run_TT($env, 1);
+is($addr, 'opensrf+9015551212 at localhost', 'helpers.get_sms_gateway_email: get back a SMS gateway address');
+
+$env = {
+    carrier  => '',
+    number   => '9015551212',
+    template => '[%- helpers.get_sms_gateway_email(carrier, number) -%]',
+};
+$addr = $r->run_TT($env, 1);
+is($addr, '', 'helpers.get_sms_gateway_email: no carrier means no SMS gateway address');

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/Application/Trigger/Reactor.pm     |    2 +-
 .../perlmods/live_t/23-action-trigger-templates.t  |   37 ++++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletions(-)
 create mode 100644 Open-ILS/src/perlmods/live_t/23-action-trigger-templates.t


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list