Exemplo n.º 1
0
def run():
    if len(sys.argv) <= 5:
        print(
            "8 arguments required (db_dialect, db_user, db_host, db_name, project_name, db_pwd, db_driver).\n"
        )
        sys.exit()

    db_dialect = sys.argv[1]
    db_user = sys.argv[2]
    db_host = sys.argv[3]
    db_name = sys.argv[4]
    project_name = sys.argv[5]

    if len(sys.argv) >= 7:
        db_pwd = sys.argv[6]
    else:
        db_pwd = ''

    if len(sys.argv) == 8:
        db_driver = sys.argv[7]
    else:
        db_driver = None

    drop_database_tables(db_dialect, db_driver, db_user, db_pwd, db_host,
                         db_name, project_name)
Exemplo n.º 2
0
    def setUpClass(cls):
        # Configure the logger.
        cls.logger = logging.getLogger('psysmon')
        cls.logger.setLevel('DEBUG')
        cls.logger.addHandler(psysmon.getLoggerHandler(log_level='DEBUG'))

        drop_database_tables(db_dialect='mysql',
                             db_driver=None,
                             db_host='localhost',
                             db_name='psysmon_unit_test',
                             db_user='******',
                             db_pwd='test',
                             project_name='unit_test')

        cls.psybase = create_psybase()
        cls.project = create_empty_project(cls.psybase)
        cls.project.dbEngine.echo = False
Exemplo n.º 3
0
    def setUpClass(cls):
        # Configure the logger.
        logger = logging.getLogger('psysmon')
        logger.setLevel('INFO')
        logger.addHandler(psysmon.getLoggerHandler())

        test_util.drop_database_tables(db_dialect='mysql',
                                       db_driver=None,
                                       db_host='localhost',
                                       db_name='psysmon_unit_test',
                                       db_user='******',
                                       db_pwd='test',
                                       project_name='unit_test')

        cls.psybase = test_util.create_psybase()
        test_util.create_full_project(cls.psybase)
        cls.project = cls.psybase.project
        cls.project.dbEngine.echo = False
        logger.setLevel('DEBUG')