OLD | NEW |
(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() |
OLD | NEW |