OLD | NEW |
| 1 #!/usr/bin/env python |
| 2 |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 3 # Copyright 2016 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 5 # found in the LICENSE file. |
4 | 6 |
5 import argparse | |
6 import client_api_generator | 7 import client_api_generator |
7 import shutil | 8 import shutil |
8 import sys | 9 import sys |
9 import tempfile | 10 import tempfile |
10 import unittest | 11 import unittest |
11 | 12 |
12 | 13 |
13 class ClientApiGeneratorTest(unittest.TestCase): | 14 class ClientApiGeneratorTest(unittest.TestCase): |
14 | 15 |
15 def test_ArgumentParsing(self): | 16 def test_ArgumentParsing(self): |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 jinja_env = client_api_generator.InitializeJinjaEnv(dirname) | 491 jinja_env = client_api_generator.InitializeJinjaEnv(dirname) |
491 client_api_generator.GenerateDomains(jinja_env, dirname, json_api, | 492 client_api_generator.GenerateDomains(jinja_env, dirname, json_api, |
492 'domain', ['cc', 'h']) | 493 'domain', ['cc', 'h']) |
493 # This is just a smoke test; we don't actually verify the generated output | 494 # This is just a smoke test; we don't actually verify the generated output |
494 # here. | 495 # here. |
495 finally: | 496 finally: |
496 shutil.rmtree(dirname) | 497 shutil.rmtree(dirname) |
497 | 498 |
498 | 499 |
499 if __name__ == '__main__': | 500 if __name__ == '__main__': |
500 cmdline_parser = argparse.ArgumentParser() | |
501 cmdline_parser.add_argument('--stamp') | |
502 args = cmdline_parser.parse_args() | |
503 unittest.main(verbosity=2, exit=False, argv=sys.argv[:1]) | 501 unittest.main(verbosity=2, exit=False, argv=sys.argv[:1]) |
504 if args.stamp: | |
505 with open(args.stamp, 'a') as f: | |
506 pass | |
OLD | NEW |