Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1181)

Side by Side Diff: infra/libs/event_mon/test/router_test.py

Issue 875403010: event_mon: actually implemented push (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebased + fixed nits Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « infra/libs/event_mon/test/monitoring_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import unittest 5 import unittest
6 6
7 from infra.libs.event_mon import router 7 from infra.libs.event_mon import router
8 from infra.libs.event_mon.log_request_lite_pb2 import LogRequestLite 8 from infra.libs.event_mon.log_request_lite_pb2 import LogRequestLite
9 9
10 10
11 class RouterTests(unittest.TestCase): 11 class RouterTests(unittest.TestCase):
12 def test_smoke(self): 12 def test_smoke(self):
13 # Use dry_run to avoid code that deals with http (including auth). 13 # Use dry_run to avoid code that deals with http (including auth).
14 r = router._Router(dry_run=True) 14 r = router._Router(endpoint=None)
15 self.assertTrue(r.close()) 15 self.assertTrue(r.close())
16 16
17 def test_push_smoke(self): 17 def test_push_smoke(self):
18 r = router._Router(dry_run=True) 18 r = router._Router(endpoint=None)
19 19
20 req = LogRequestLite.LogEventLite() 20 req = LogRequestLite.LogEventLite()
21 req.event_time_ms = router.time_ms() 21 req.event_time_ms = router.time_ms()
22 req.event_code = 1 22 req.event_code = 1
23 req.event_flow_id = 2 23 req.event_flow_id = 2
24 r.push_event(req) 24 r.push_event(req)
25 self.assertTrue(r.close()) 25 self.assertTrue(r.close())
26 26
27 def test_push_error_handling(self): 27 def test_push_error_handling(self):
28 r = router._Router(dry_run=True) 28 r = router._Router(endpoint=None)
29 r.push_event(None) 29 r.push_event(None)
30 self.assertTrue(r.close()) 30 self.assertTrue(r.close())
OLDNEW
« no previous file with comments | « infra/libs/event_mon/test/monitoring_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698