Beispiel #1
0
def step(context, fixture_name, data_set_name):
    ensure_data_set_exists(context, data_set_name)
    fixture_path = os.path.join(FIXTURE_PATH, fixture_name)
    with open(fixture_path) as fixture:
        for obj in json.load(fixture):
            for key in ['_timestamp', '_day_start_at',
                        '_week_start_at', '_month_start_at']:
                if key in obj:
                    obj[key] = parser.parse(obj[key]).astimezone(pytz.utc)
            context.client.storage().save_record(data_set_name, obj)
Beispiel #2
0
def step(context, fixture_name, data_set_name):
    settings = get_data_set_settings_from_context_table(context.table)

    ensure_data_set_exists(context, data_set_name, settings)
    fixture_path = os.path.join(FIXTURE_PATH, fixture_name)
    with open(fixture_path) as fixture:
        for obj in json.load(fixture):
            for key in ['_timestamp', '_day_start_at',
                        '_week_start_at', '_month_start_at']:
                if key in obj:
                    obj[key] = parser.parse(obj[key]).astimezone(pytz.utc)
            context.client.mongo()[data_set_name].save(obj)
Beispiel #3
0
def step(context, fixture_name, data_set_name):
    settings = get_data_set_settings_from_context_table(context.table)

    ensure_data_set_exists(context, data_set_name, settings)
    fixture_path = os.path.join(FIXTURE_PATH, fixture_name)
    with open(fixture_path) as fixture:
        for obj in json.load(fixture):
            for key in [
                    '_timestamp', '_day_start_at', '_week_start_at',
                    '_month_start_at'
            ]:
                if key in obj:
                    obj[key] = parser.parse(obj[key]).astimezone(pytz.utc)
            context.client.mongo()[data_set_name].save(obj)
Beispiel #4
0
def step(context, data_set_name):
    settings = get_data_set_settings_from_context_table(context.table)
    ensure_data_set_exists(context, data_set_name, settings)