def given_i_have_to_following_queue_log_entries_in_the_last_hour(step): one_hour_ago = datetime.now() - timedelta(hours=1) world.beginning_of_last_hour = one_hour_ago.replace(minute=0, second=0, microsecond=0) for entry in step.hashes: entry_time = datetime.strptime(entry['time'], "%M:%S.%f") last_hour_entry_time = entry_time.replace(year=one_hour_ago.year, month=one_hour_ago.month, day=one_hour_ago.day, hour=one_hour_ago.hour) entry['time'] = last_hour_entry_time.strftime("%Y-%m-%d %H:%M:%S.%f") queuelog_helper.insert_entries(step.hashes)
def given_i_have_the_following_queue_log_entries(step): queuelog_helper.insert_entries(step.hashes)