def tests_create_all(self): with mock.patch("corral.db.Model.metadata.create_all") as m_create_all: db.create_all() self.assertTrue(m_create_all.called) with mock.patch("corral.db.Model.metadata.create_all") as m_create_all: db.create_all(a=1) self.assertTrue(m_create_all.called) self.assertEquals(m_create_all.call_args[1], {"a": 1})
def main(argv): parser = create_parser() arguments = parser.parse_args(argv) os.environ.setdefault("CORRAL_SETTINGS_MODULE", arguments.settings) from corral import core, conf, db # SETUP THE ENVIRONMENT if arguments.verbosity < 3: conf.settings.DEBUG = False core.setup_environment() db.create_all() core.logger.setLevel(core.logging.CRITICAL) # RUN THE TESTS result = run_tests(verbosity=arguments.verbosity, failfast=arguments.failfast) # EXIT WITH CORRECT STATUS sys.exit(not result.wasSuccessful())
def main(argv): parser = create_parser() arguments = parser.parse_args(argv) os.environ.setdefault("CORRAL_SETTINGS_MODULE", arguments.settings) from corral import core, conf, db # SETUP THE ENVIRONMENT if arguments.verbosity < 3: conf.settings.DEBUG = False core.setup_environment() db.create_all() core.logger.setLevel(core.logging.CRITICAL) # RUN THE TESTS result = run_tests( verbosity=arguments.verbosity, failfast=arguments.failfast) # EXIT WITH CORRECT STATUS sys.exit(not result.wasSuccessful())
def setUp(self): from corral import db db.create_all() self.setup()