OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/python | |
2 | |
3 # Copyright 2014 Google Inc. | |
4 # | |
5 # Use of this source code is governed by a BSD-style license that can be | |
6 # found in the LICENSE file. | |
7 | |
8 """ | |
9 Test generate_user_config.py. | |
10 """ | |
11 | |
12 import os | |
13 import sys | |
14 import tempfile | |
15 import test_variables | |
16 import unittest | |
17 | |
18 sys.path.append(test_variables.GYP_GEN_DIR) | |
19 | |
20 from generate_user_config import generate_user_config as gen_config | |
21 from vars_dict_lib import OrderedSet | |
22 | |
23 class GenUserConfigTest(unittest.TestCase): | |
24 | |
25 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
| |
26 """Calling generate_user_config without an SkUserConfig asserts.""" | |
27 tmp = tempfile.mkdtemp() | |
28 original = os.path.join(tmp, 'filename') | |
29 assert not os.path.exists(original) | |
30 | |
31 with self.assertRaises(AssertionError): | |
32 ordered_set = OrderedSet() | |
33 ordered_set.add('define') | |
34 gen_config(original_sk_user_config=original, target_dir=tmp, | |
35 ordered_set=ordered_set) | |
36 | |
37 | |
38 def main(): | |
39 loader = unittest.TestLoader() | |
40 suite = loader.loadTestsFromTestCase(GenUserConfigTest) | |
41 unittest.TextTestRunner(verbosity=2).run(suite) | |
42 | |
43 if __name__ == "__main__": | |
44 main() | |
45 | |
OLD | NEW |