8 class EventTestBase(object):
10 run_test_server.authorize_with("admin")
11 events = Queue.Queue(3)
12 self.ws = arvados.events.subscribe(
13 arvados.api('v1'), [['object_uuid', 'is_a', 'arvados#human']],
14 events.put, poll_fallback=2)
15 self.assertIsInstance(self.ws, self.WS_TYPE)
16 self.assertEqual(200, events.get(True, 10)['status'])
17 human = arvados.api('v1').humans().create(body={}).execute()
18 self.assertEqual(human['uuid'], events.get(True, 10)['object_uuid'])
19 self.assertTrue(events.empty(), "got more events than expected")
24 except AttributeError:
26 super(EventTestBase, self).tearDown()
29 class WebsocketTest(EventTestBase, run_test_server.TestCaseWithServers):
30 MAIN_SERVER = {'websockets': True}
31 WS_TYPE = arvados.events.EventClient
34 class PollClientTest(EventTestBase, run_test_server.TestCaseWithServers):
36 WS_TYPE = arvados.events.PollClient