def generate_test(file): """ Generate a given test. """ import sys, os sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) import tests config = tests.get_config(os.path.dirname(file)) root, ext = os.path.splitext(file) if ext == config.get(tests.get_section(os.path.basename(root), config), 'input_ext'): tests.generate(root, config) else: print file, 'does not have a valid file extension. Check config.'
#!/usr/bin/env python import tests import os, sys if len(sys.argv) > 1 and sys.argv[1] == "update": if len(sys.argv) > 2: config = tests.get_config(os.path.dirname(sys.argv[2])) root, ext = os.path.splitext(sys.argv[2]) if ext == config.get(tests.get_section(os.path.basename(root), config), 'input_ext'): tests.generate(root, config) else: print(sys.argv[2], 'does not have a valid file extension. Check config.') else: tests.generate_all() else: tests.run()
#!/usr/bin/env python import tests import os, sys, getopt if len(sys.argv) > 1 and sys.argv[1] == "update": if len(sys.argv) > 2: config = tests.get_config(os.path.dirname(sys.argv[2])) root, ext = os.path.splitext(sys.argv[2]) if ext == config.get(tests.get_section(os.path.basename(root), config), 'input_ext'): tests.generate(root, config) else: print(file, 'does not have a valid file extension. Check config.') else: tests.generate_all() else: tests.run()