# Path: urbanaccess/gtfs/gtfsfeeds_dataframe.py
# class urbanaccess_gtfs_df(object):
#     """
#     A collection of DataFrames representing the standardized and
#     merged metropolitan-wide transit network from multiple
#     GTFS feeds.
# 
#     Parameters
#     ----------
#     gtfsfeeds_dfs : object
#         processed DataFrames of corresponding GTFS feed text files
#     gtfsfeeds_dfs.stops : pandas.DataFrame
#     gtfsfeeds_dfs.routes : pandas.DataFrame
#     gtfsfeeds_dfs.trips : pandas.DataFrame
#     gtfsfeeds_dfs.stop_times : pandas.DataFrame
#     gtfsfeeds_dfs.calendar : pandas.DataFrame
#     gtfsfeeds_dfs.calendar_dates : pandas.DataFrame
#     gtfsfeeds_dfs.stop_times_int : pandas.DataFrame
#     gtfsfeeds_dfs.headways : pandas.DataFrame
#     """
# 
#     def __init__(self,
#                  stops=pd.DataFrame(),
#                  routes=pd.DataFrame(),
#                  trips=pd.DataFrame(),
#                  stop_times=pd.DataFrame(),
#                  calendar=pd.DataFrame(),
#                  calendar_dates=pd.DataFrame(),
#                  stop_times_int=pd.DataFrame(),
#                  headways=pd.DataFrame()):
#         self.stops = stops
#         self.routes = routes
#         self.trips = trips
#         self.stop_times = stop_times
#         self.calendar = calendar
#         self.calendar_dates = calendar_dates
#         self.stop_times_int = stop_times_int
#         self.headways = headways


import pytest
import pandas as pd
import os
import six
import codecs
import sys
import urbanaccess.gtfs.load as gtfs_load
from urbanaccess.gtfs.gtfsfeeds_dataframe import urbanaccess_gtfs_df
        gtfsfeed_path=feed_dir,
        validation=False,
        verbose=True,
        bbox=None,
        remove_stops_outsidebbox=False,
        append_definitions=False)
    assert isinstance(loaded_feeds, urbanaccess_gtfs_df)
    urbanaccess_gtfs_df_info = vars(loaded_feeds)
    expected_dfs = ['stops', 'routes', 'trips', 'stop_times',
                    'calendar']
    assert expected_urbanaccess_gtfs_df_keys == sorted(list(
        urbanaccess_gtfs_df_info.keys()))
    for key, value in urbanaccess_gtfs_df_info.items():
        assert isinstance(value, pd.core.frame.DataFrame)
        # check that df is not empty
        if key in expected_dfs:
            assert value.empty is False


def test_loadgtfsfeed_to_df_w_calendar_and_calendar_dates(
        agency_a_feed_on_disk_w_calendar_and_calendar_dates,
        expected_urbanaccess_gtfs_df_keys):
    feed_dir = agency_a_feed_on_disk_w_calendar_and_calendar_dates
    loaded_feeds = gtfs_load.gtfsfeed_to_df(
        gtfsfeed_path=feed_dir,
        validation=False,
        verbose=True,
        bbox=None,
        remove_stops_outsidebbox=False,
        append_definitions=False)

# Path: urbanaccess/gtfs/gtfsfeeds_dataframe.py
# class urbanaccess_gtfs_df(object):
#     """
#     A collection of DataFrames representing the standardized and
#     merged metropolitan-wide transit network from multiple
#     GTFS feeds.
# 
#     Parameters
#     ----------
#     gtfsfeeds_dfs : object
#         processed DataFrames of corresponding GTFS feed text files
#     gtfsfeeds_dfs.stops : pandas.DataFrame
#     gtfsfeeds_dfs.routes : pandas.DataFrame
#     gtfsfeeds_dfs.trips : pandas.DataFrame
#     gtfsfeeds_dfs.stop_times : pandas.DataFrame
#     gtfsfeeds_dfs.calendar : pandas.DataFrame
#     gtfsfeeds_dfs.calendar_dates : pandas.DataFrame
#     gtfsfeeds_dfs.stop_times_int : pandas.DataFrame
#     gtfsfeeds_dfs.headways : pandas.DataFrame
#     """
# 
#     def __init__(self,
#                  stops=pd.DataFrame(),
#                  routes=pd.DataFrame(),
#                  trips=pd.DataFrame(),
#                  stop_times=pd.DataFrame(),
#                  calendar=pd.DataFrame(),
#                  calendar_dates=pd.DataFrame(),
#                  stop_times_int=pd.DataFrame(),
#                  headways=pd.DataFrame()):
#         self.stops = stops
#         self.routes = routes
#         self.trips = trips
#         self.stop_times = stop_times
#         self.calendar = calendar
#         self.calendar_dates = calendar_dates
#         self.stop_times_int = stop_times_int
#         self.headways = headways


# Path: urbanaccess/tests/test_gtfs_load.py
import pytest
import pandas as pd
import os
import six
import codecs
import sys
import urbanaccess.gtfs.load as gtfs_load
from urbanaccess.gtfs.gtfsfeeds_dataframe import urbanaccess_gtfs_df

        gtfsfeed_path=feed_dir,
        validation=False,
        verbose=True,
        bbox=None,
        remove_stops_outsidebbox=False,
        append_definitions=False)
    assert isinstance(loaded_feeds, urbanaccess_gtfs_df)
    urbanaccess_gtfs_df_info = vars(loaded_feeds)
    expected_dfs = ['stops', 'routes', 'trips', 'stop_times',
                    'calendar']
    assert expected_urbanaccess_gtfs_df_keys == sorted(list(
        urbanaccess_gtfs_df_info.keys()))
    for key, value in urbanaccess_gtfs_df_info.items():
        assert isinstance(value, pd.core.frame.DataFrame)
        # check that df is not empty
        if key in expected_dfs:
            assert value.empty is False


def test_loadgtfsfeed_to_df_w_calendar_and_calendar_dates(
        agency_a_feed_on_disk_w_calendar_and_calendar_dates,
        expected_urbanaccess_gtfs_df_keys):
    feed_dir = agency_a_feed_on_disk_w_calendar_and_calendar_dates
    loaded_feeds = gtfs_load.gtfsfeed_to_df(
        gtfsfeed_path=feed_dir,
        validation=False,
        verbose=True,
        bbox=None,
        remove_stops_outsidebbox=False,
        append_definitions=False)

    assert isinstance(loaded_feeds, urbanaccess_gtfs_df)