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

Side by Side Diff: tools/metrics/ukm/pretty_print_test.py

Issue 2769223005: Create a UKM descriptions XML file (Closed)
Patch Set: Add more metrics Created 3 years, 9 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
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2017 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
rkaplow 2017/03/30 01:26:20 update this file since it's not really testing any
Steven Holte 2017/03/30 22:42:23 Done.
6 import unittest
7
8 import pretty_print
9
10
11 PRETTY_XML = """
12 <!-- Comment1 -->
13
14 <ukm-configuration>
15
16 </ukm-configuration>
17 """.strip()
18
19 BASIC_METRIC = {
20 'comments': [],
21 'name': 'Test.Rappor.Metric',
22 'type': 'TEST_RAPPOR_TYPE',
23 'owners': ['user1@chromium.org', 'user2@chromium.org'],
24 'summary': 'A fake metric summary.',
25 'flags': [],
26 'strings': [],
27 }
28
29 MULTI_FIELD_METRIC = {
30 'comments': [],
31 'name': 'Test.Rappor.Metric2',
32 'type': 'TEST_RAPPOR_TYPE',
33 'owners': ['user1@chromium.org', 'user2@chromium.org'],
34 'summary': 'A fake metric summary.',
35 'strings': [{
36 'comments': [],
37 'name': 'Url',
38 'summary': 'The url of the event.',
39 }],
40 'flags': [{
41 'comments': [],
42 'name': 'Flags',
43 'flags': [
44 'Flag bit #1',
45 'Flag bit #2',
46 ]
47 }]
48 }
49
50
51 class UkmXmlTest(unittest.TestCase):
52
53 def testIsPretty(self):
54 result = pretty_print.UpdateXML(PRETTY_XML)
55 self.assertMultiLineEqual(PRETTY_XML, result.strip())
56
57
58 if __name__ == '__main__':
59 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698