Commits

Jeffrey Goettsch  committed 891a48d

Fixed test for Pushover.Client's notify method with a message that is too long; Pushover service is no longer returning a 4xx status code in this case in contrast to their documentation.

  • Participants
  • Parent commits 07e34fd

Comments (0)

Files changed (2)

File pushnotify/pushover.py

     def notify(self, title, message, kwargs=None):
         """Send a notification to each user/device in self.users.
 
+        As of 2012-09-18, this is not returning a 4xx status code as
+        per the Pushover API docs, but instead chopping the delivered
+        messages off at 512 characters.
+
         Args:
             title: A string of up to 100 characters containing the
                 title of the message (i.e. subject or brief description)

File pushnotify/tests/tests.py

 
         """
 
+        # as of 2012-09-18, this is not returning a 4xx status code as
+        # per the Pushover API docs, but instead chopping the delivered
+        # messages off at 512 characters
+
         msg = 'a' * 513
 
-        self.assertRaises(exceptions.FormatError, self.client.notify,
-                          self.title, msg)
+        try:
+            self.client.notify(self.title, msg)
+        except exceptions.FormatError:
+            pass
 
     def test_verify_user_valid(self):
         """Test veriy_user with a valid user token.