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

Side by Side Diff: infra_libs/ts_mon/test/targets_test.py

Issue 1260293009: make version of ts_mon compatible with appengine (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: add noncululativedistribution metric to ts_mon imports Created 5 years, 4 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/ts_mon/test/stubs.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 unittest
6
7 from monacq.proto import metrics_pb2
8
9 from infra_libs.ts_mon import targets
10
11
12 class DeviceTargetTest(unittest.TestCase):
13
14 def test_populate_target(self):
15 pb = metrics_pb2.MetricsData()
16 t = targets.DeviceTarget('reg', 'net', 'host')
17 t._populate_target_pb(pb)
18 self.assertEquals(pb.network_device.metro, 'reg')
19 self.assertEquals(pb.network_device.hostgroup, 'net')
20 self.assertEquals(pb.network_device.hostname, 'host')
21 self.assertEquals(pb.network_device.realm, 'ACQ_CHROME')
22 self.assertEquals(pb.network_device.alertable, True)
23
24
25 class TaskTargetTest(unittest.TestCase):
26
27 def test_populate_target(self):
28 pb = metrics_pb2.MetricsData()
29 t = targets.TaskTarget('serv', 'job', 'reg', 'host')
30 t._populate_target_pb(pb)
31 self.assertEquals(pb.task.service_name, 'serv')
32 self.assertEquals(pb.task.job_name, 'job')
33 self.assertEquals(pb.task.data_center, 'reg')
34 self.assertEquals(pb.task.host_name, 'host')
35 self.assertEquals(pb.task.task_num, 0)
OLDNEW
« no previous file with comments | « infra_libs/ts_mon/test/stubs.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698