[ARVADOS] updated: a45c162ac02bb261fc65d3d59b446f0610c3ab8f

git at public.curoverse.com git at public.curoverse.com
Thu Jul 16 09:14:01 EDT 2015


Summary of changes:
 sdk/python/tests/test_websockets.py | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

       via  a45c162ac02bb261fc65d3d59b446f0610c3ab8f (commit)
      from  ca8e8224203ba5be3a9a190862e7c8ac2ac94e7e (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.


commit a45c162ac02bb261fc65d3d59b446f0610c3ab8f
Author: radhika <radhika at curoverse.com>
Date:   Thu Jul 16 09:05:54 2015 -0400

    6473: some more error tests

diff --git a/sdk/python/tests/test_websockets.py b/sdk/python/tests/test_websockets.py
index 6889c6f..6d0a2f2 100644
--- a/sdk/python/tests/test_websockets.py
+++ b/sdk/python/tests/test_websockets.py
@@ -38,10 +38,10 @@ class WebsocketTest(run_test_server.TestCaseWithServers):
             poll_fallback=False, expect_type=arvados.events.EventClient)
 
     def test_subscribe_websocket_with_start_time_today(self):
-        lastHour = datetime.today() - timedelta(hours = 1)
+        now = datetime.today()
         self._test_subscribe(
             poll_fallback=False, expect_type=arvados.events.EventClient,
-                additional_filters=[['created_at', '>', lastHour.strftime('%Y-%m-%d')]])
+                additional_filters=[['created_at', '>', now.strftime('%Y-%m-%d')]])
 
     def test_subscribe_websocket_with_start_time_last_hour(self):
         lastHour = datetime.today() - timedelta(hours = 1)
@@ -56,6 +56,25 @@ class WebsocketTest(run_test_server.TestCaseWithServers):
                 poll_fallback=False, expect_type=arvados.events.EventClient,
                     additional_filters=[['created_at', '>', nextHour.strftime('%Y-%m-%d %H:%M:%S')]])
 
+    def test_subscribe_websocket_with_start_time_tomorrow(self):
+        tomorrow = datetime.today() + timedelta(hours = 24)
+        with self.assertRaises(Queue.Empty):
+            self._test_subscribe(
+                poll_fallback=False, expect_type=arvados.events.EventClient,
+                    additional_filters=[['created_at', '>', tomorrow.strftime('%Y-%m-%d')]])
+
+    def test_subscribe_websocket_with_start_time_incorrect_date_format(self):
+        now = datetime.today()
+        self._test_subscribe(
+            poll_fallback=False, expect_type=arvados.events.EventClient,
+                additional_filters=[['created_at', '>', now.strftime('%Y-%m')]])
+
+    def test_subscribe_websocket_with_start_time_incorrect_time_format(self):
+        now = datetime.today()
+        self._test_subscribe(
+            poll_fallback=False, expect_type=arvados.events.EventClient,
+                additional_filters=[['created_at', '>', now.strftime('%Y-%m-%d %H:%M')]])
+
     @mock.patch('arvados.events.EventClient.__init__')
     def test_subscribe_poll(self, event_client_constr):
         event_client_constr.side_effect = Exception('All is well')

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list