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

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

Issue 1157383006: Removed infra/libs/event_mon (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 6 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
(Empty)
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
3 # found in the LICENSE file.
4
5 import os
6 import unittest
7
8 from infra.libs.event_mon import router
9 from infra.libs.event_mon.log_request_lite_pb2 import LogRequestLite
10
11
12 DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data')
13
14
15 class RouterTests(unittest.TestCase):
16 def test_smoke(self):
17 # Use dry_run to avoid code that deals with http (including auth).
18 r = router._Router({}, endpoint=None)
19 self.assertTrue(r.close())
20
21 def test_smoke_with_credentials(self):
22 cache = {'service_account_creds':
23 os.path.join(DATA_DIR, 'valid_creds.json'),
24 'service_accounts_creds_root': 'whatever.the/other/is/absolute'}
25 r = router._Router(cache, endpoint='https://any.where')
26 self.assertTrue(r.close())
27
28 def test_push_smoke(self):
29 r = router._Router({}, endpoint=None)
30
31 req = LogRequestLite.LogEventLite()
32 req.event_time_ms = router.time_ms()
33 req.event_code = 1
34 req.event_flow_id = 2
35 r.push_event(req)
36 self.assertTrue(r.close())
37
38 def test_push_error_handling(self):
39 r = router._Router({}, endpoint=None)
40 r.push_event(None)
41 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