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

Side by Side Diff: components/policy/tools/template_writers/writers/chromeos_adml_writer_unittest.py

Issue 2481183002: Generate ADMX template for Chrome OS policies (Closed)
Patch Set: Couple of fixes after testing Created 3 years, 3 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
6
7 """Unittests for writers.chromeos_adml_writer."""
8
9
10 import os
11 import sys
12 import unittest
13 if __name__ == '__main__':
14 sys.path.append(os.path.join(os.path.dirname(__file__), '../../../..'))
15
16
17 from writers import chromeos_adml_writer
18 from writers import adml_writer_unittest
19
20
21 class ChromeOsAdmlWriterUnittest(
22 adml_writer_unittest.AdmlWriterUnittest):
23
24 # Overridden.
25 def _GetWriter(self, config):
26 return chromeos_adml_writer.GetWriter(config)
27
28 # Overridden
29 def GetCategory(self):
30 return "cros_test_category";
31
32 # Overridden
33 def GetCategoryString(self):
34 return "CrOSTestCategory";
35
36 # Overridden.
37 def testPlatform(self):
38 # Test that the writer correctly chooses policies of platform Chrome OS.
39 self.assertTrue(self.writer.IsPolicySupported({
40 'supported_on': [
41 {'platforms': ['chrome_os', 'zzz']}, {'platforms': ['aaa']}
42 ]
43 }))
44 self.assertFalse(self.writer.IsPolicySupported({
45 'supported_on': [
46 {'platforms': ['win', 'mac', 'linux']}, {'platforms': ['aaa']}
47 ]
48 }))
49
50
51 if __name__ == '__main__':
52 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698