コード例 #1
0
    def load_definitions(sess, force_tas_load, ruleList=None):
        """Load file definitions."""
        validator_config_path = os.path.join(CONFIG_BROKER["path"],
                                             "dataactvalidator", "config")
        integration_test_data_path = os.path.join(CONFIG_BROKER["path"],
                                                  "tests", "integration",
                                                  "data")

        SchemaLoader.loadAllFromPath(validator_config_path)
        SQLLoader.loadSql("sqlRules.csv")

        if ruleList is not None:
            # If rule list provided, drop all other rules
            sess.query(RuleSql).filter(not_(
                RuleSql.rule_label.in_(ruleList))).delete(
                    synchronize_session='fetch')
            sess.commit()

        # Load domain values tables
        loadDomainValues(
            validator_config_path,
            os.path.join(integration_test_data_path, "program_activity.csv"))
        if sess.query(TASLookup).count() == 0 or force_tas_load:
            # TAS table is empty, load it
            loadTas(tasFile=os.path.join(integration_test_data_path,
                                         "cars_tas.csv"))

        # Load test SF-133
        load_all_sf133(integration_test_data_path)
コード例 #2
0
def load_sf133():
    logger.info('Loading SF-133')
    # Unlike other domain value files, SF 133 data is stored
    # on S3. If the application's 'use_aws' option is turned
    # off, tell the SF 133 load to look for files in the
    # validator's local config file instead
    if CONFIG_BROKER['use_aws']:
        load_all_sf133()
    else:
        load_all_sf133(validator_config_path)
コード例 #3
0
def load_sf133():
    logger.info('Loading SF-133')
    # Unlike other domain value files, SF 133 data is stored
    # on S3. If the application's 'use_aws' option is turned
    # off, tell the SF 133 load to look for files in the
    # validator's local config file instead
    if CONFIG_BROKER['use_aws']:
        load_all_sf133()
    else:
        load_all_sf133(validator_config_path)