示例#1
0
    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})
示例#2
0
    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})
示例#3
0
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())
示例#4
0
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())
示例#5
0
 def setUp(self):
     from corral import db
     db.create_all()
     self.setup()
示例#6
0
 def setUp(self):
     from corral import db
     db.create_all()
     self.setup()