+ def _test_subscribe(self, poll_fallback, expect_type):
+ run_test_server.authorize_with('active')
+ events = Queue.Queue(3)
+ self.ws = arvados.events.subscribe(
+ arvados.api('v1'), [['object_uuid', 'is_a', 'arvados#human']],
+ events.put, poll_fallback=poll_fallback)
+ self.assertIsInstance(self.ws, expect_type)
+ self.assertEqual(200, events.get(True, 10)['status'])
+ human = arvados.api('v1').humans().create(body={}).execute()
+ self.assertEqual(human['uuid'], events.get(True, 10)['object_uuid'])
+ self.assertTrue(events.empty(), "got more events than expected")