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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: components/policy/tools/template_writers/writers/chromeos_adml_writer_unittest.py
diff --git a/components/policy/tools/template_writers/writers/chromeos_adml_writer_unittest.py b/components/policy/tools/template_writers/writers/chromeos_adml_writer_unittest.py
new file mode 100755
index 0000000000000000000000000000000000000000..38f7114e8b223d9d55d25efee2a2cfd5d647bc67
--- /dev/null
+++ b/components/policy/tools/template_writers/writers/chromeos_adml_writer_unittest.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Unittests for writers.chromeos_adml_writer."""
+
+
+import os
+import sys
+import unittest
+if __name__ == '__main__':
+ sys.path.append(os.path.join(os.path.dirname(__file__), '../../../..'))
+
+
+from writers import chromeos_adml_writer
+from writers import adml_writer_unittest
+
+
+class ChromeOsAdmlWriterUnittest(
+ adml_writer_unittest.AdmlWriterUnittest):
+
+ # Overridden.
+ def _GetWriter(self, config):
+ return chromeos_adml_writer.GetWriter(config)
+
+ # Overridden
+ def GetCategory(self):
+ return "cros_test_category";
+
+ # Overridden
+ def GetCategoryString(self):
+ return "CrOSTestCategory";
+
+ # Overridden.
+ def testPlatform(self):
+ # Test that the writer correctly chooses policies of platform Chrome OS.
+ self.assertTrue(self.writer.IsPolicySupported({
+ 'supported_on': [
+ {'platforms': ['chrome_os', 'zzz']}, {'platforms': ['aaa']}
+ ]
+ }))
+ self.assertFalse(self.writer.IsPolicySupported({
+ 'supported_on': [
+ {'platforms': ['win', 'mac', 'linux']}, {'platforms': ['aaa']}
+ ]
+ }))
+
+
+if __name__ == '__main__':
+ unittest.main()

Powered by Google App Engine
This is Rietveld 408576698