Chromium Code Reviews| Index: platform_tools/android/tests/generate_user_config_tests.py |
| diff --git a/platform_tools/android/tests/generate_user_config_tests.py b/platform_tools/android/tests/generate_user_config_tests.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c9045d3207586cf4f1d7219f774f22ebab3c944a |
| --- /dev/null |
| +++ b/platform_tools/android/tests/generate_user_config_tests.py |
| @@ -0,0 +1,45 @@ |
| +#!/usr/bin/python |
| + |
| +# Copyright 2014 Google Inc. |
| +# |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +""" |
| +Test generate_user_config.py. |
| +""" |
| + |
| +import os |
| +import sys |
| +import tempfile |
| +import test_variables |
| +import unittest |
| + |
| +sys.path.append(test_variables.GYP_GEN_DIR) |
| + |
| +from generate_user_config import generate_user_config as gen_config |
| +from vars_dict_lib import OrderedSet |
| + |
| +class GenUserConfigTest(unittest.TestCase): |
| + |
| + def test_missing_sk_user_config(self): |
|
scroggo
2014/03/25 22:03:00
I plan to add a test similar to the comparison tes
|
| + """Calling generate_user_config without an SkUserConfig asserts.""" |
| + tmp = tempfile.mkdtemp() |
| + original = os.path.join(tmp, 'filename') |
| + assert not os.path.exists(original) |
| + |
| + with self.assertRaises(AssertionError): |
| + ordered_set = OrderedSet() |
| + ordered_set.add('define') |
| + gen_config(original_sk_user_config=original, target_dir=tmp, |
| + ordered_set=ordered_set) |
| + |
| + |
| +def main(): |
| + loader = unittest.TestLoader() |
| + suite = loader.loadTestsFromTestCase(GenUserConfigTest) |
| + unittest.TextTestRunner(verbosity=2).run(suite) |
| + |
| +if __name__ == "__main__": |
| + main() |
| + |