# Path: urbanaccess/gtfsfeeds.py
# class urbanaccess_gtfsfeeds(object):
#     def __init__(self,
#                  gtfs_feeds={}):
#     def from_yaml(cls, gtfsfeeddir=os.path.join(config.settings.data_folder,
#                                                 'gtfsfeeds'),
#                   yamlname='gtfsfeeds.yaml'):
#     def to_dict(self):
#     def add_feed(self, add_dict, replace=False):
#     def remove_feed(self, del_key=None, remove_all=False):
#     def to_yaml(self, gtfsfeeddir=os.path.join(config.settings.data_folder,
#                                                'gtfsfeeds'),
#                 yamlname='gtfsfeeds.yaml',
#                 overwrite=False):
# def search(api='gtfsdataexch', search_text=None, search_field=None,
#            match='contains', add_feed=False, overwrite_feed=False):
# def download(data_folder=os.path.join(config.settings.data_folder),
#              feed_name=None, feed_url=None, feed_dict=None,
#              error_pause_duration=5, delete_zips=False):
# def _unzip(zip_rootpath, delete_zips=True):
# def _zipfile_type_check(file, feed_url_value):
# 
# Path: urbanaccess/gtfsfeeds.py
# class urbanaccess_gtfsfeeds(object):
#     def __init__(self,
#                  gtfs_feeds={}):
#     def from_yaml(cls, gtfsfeeddir=os.path.join(config.settings.data_folder,
#                                                 'gtfsfeeds'),
#                   yamlname='gtfsfeeds.yaml'):
#     def to_dict(self):
#     def add_feed(self, add_dict, replace=False):
#     def remove_feed(self, del_key=None, remove_all=False):
#     def to_yaml(self, gtfsfeeddir=os.path.join(config.settings.data_folder,
#                                                'gtfsfeeds'),
#                 yamlname='gtfsfeeds.yaml',
#                 overwrite=False):
# def search(api='gtfsdataexch', search_text=None, search_field=None,
#            match='contains', add_feed=False, overwrite_feed=False):
# def download(data_folder=os.path.join(config.settings.data_folder),
#              feed_name=None, feed_url=None, feed_dict=None,
#              error_pause_duration=5, delete_zips=False):
# def _unzip(zip_rootpath, delete_zips=True):
# def _zipfile_type_check(file, feed_url_value):


import pytest
import os
import pandas as pd
import yaml
from urbanaccess import gtfsfeeds
from urbanaccess.gtfsfeeds import feeds
            '/latest.zip'}


@pytest.fixture
def feed_dict3():
    return {
        'ac transit': 'http://www.actransit.org/wp-content/uploads'
                      '/GTFSJune182017B.zip',
        'Bay Area Rapid Transit':
            'http://www.gtfs-data-exchange.com/agency/bay-area-rapid-transit'
            '/latest.zip'}


@pytest.fixture
def feed_yaml(tmpdir):
    yaml_dict = {
        'gtfs_feeds': {
            'ac transit': 'http://www.actransit.org/wp-content/uploads'
                          '/GTFSJune182017B.zip',
            'Bay Area Rapid Transit':
                'http://www.gtfs-data-exchange.com/agency/bay-area-rapid'
                '-transit/latest.zip'}}

    yaml_path = os.path.join(tmpdir.strpath, 'gtfsfeeds.yaml')
    with open(yaml_path, 'w') as f:
        yaml.dump(yaml_dict, f, default_flow_style=False)
    return tmpdir.strpath


def test_feed_object():

# Path: urbanaccess/gtfsfeeds.py
# class urbanaccess_gtfsfeeds(object):
#     def __init__(self,
#                  gtfs_feeds={}):
#     def from_yaml(cls, gtfsfeeddir=os.path.join(config.settings.data_folder,
#                                                 'gtfsfeeds'),
#                   yamlname='gtfsfeeds.yaml'):
#     def to_dict(self):
#     def add_feed(self, add_dict, replace=False):
#     def remove_feed(self, del_key=None, remove_all=False):
#     def to_yaml(self, gtfsfeeddir=os.path.join(config.settings.data_folder,
#                                                'gtfsfeeds'),
#                 yamlname='gtfsfeeds.yaml',
#                 overwrite=False):
# def search(api='gtfsdataexch', search_text=None, search_field=None,
#            match='contains', add_feed=False, overwrite_feed=False):
# def download(data_folder=os.path.join(config.settings.data_folder),
#              feed_name=None, feed_url=None, feed_dict=None,
#              error_pause_duration=5, delete_zips=False):
# def _unzip(zip_rootpath, delete_zips=True):
# def _zipfile_type_check(file, feed_url_value):
# 
# Path: urbanaccess/gtfsfeeds.py
# class urbanaccess_gtfsfeeds(object):
#     def __init__(self,
#                  gtfs_feeds={}):
#     def from_yaml(cls, gtfsfeeddir=os.path.join(config.settings.data_folder,
#                                                 'gtfsfeeds'),
#                   yamlname='gtfsfeeds.yaml'):
#     def to_dict(self):
#     def add_feed(self, add_dict, replace=False):
#     def remove_feed(self, del_key=None, remove_all=False):
#     def to_yaml(self, gtfsfeeddir=os.path.join(config.settings.data_folder,
#                                                'gtfsfeeds'),
#                 yamlname='gtfsfeeds.yaml',
#                 overwrite=False):
# def search(api='gtfsdataexch', search_text=None, search_field=None,
#            match='contains', add_feed=False, overwrite_feed=False):
# def download(data_folder=os.path.join(config.settings.data_folder),
#              feed_name=None, feed_url=None, feed_dict=None,
#              error_pause_duration=5, delete_zips=False):
# def _unzip(zip_rootpath, delete_zips=True):
# def _zipfile_type_check(file, feed_url_value):


# Path: urbanaccess/tests/test_gtfsfeeds.py
import pytest
import os
import pandas as pd
import yaml
from urbanaccess import gtfsfeeds
from urbanaccess.gtfsfeeds import feeds

            '/latest.zip'}


@pytest.fixture
def feed_dict3():
    return {
        'ac transit': 'http://www.actransit.org/wp-content/uploads'
                      '/GTFSJune182017B.zip',
        'Bay Area Rapid Transit':
            'http://www.gtfs-data-exchange.com/agency/bay-area-rapid-transit'
            '/latest.zip'}


@pytest.fixture
def feed_yaml(tmpdir):
    yaml_dict = {
        'gtfs_feeds': {
            'ac transit': 'http://www.actransit.org/wp-content/uploads'
                          '/GTFSJune182017B.zip',
            'Bay Area Rapid Transit':
                'http://www.gtfs-data-exchange.com/agency/bay-area-rapid'
                '-transit/latest.zip'}}

    yaml_path = os.path.join(tmpdir.strpath, 'gtfsfeeds.yaml')
    with open(yaml_path, 'w') as f:
        yaml.dump(yaml_dict, f, default_flow_style=False)
    return tmpdir.strpath


def test_feed_object():

    assert isinstance(gtfsfeeds.feeds, gtfsfeeds.urbanaccess_gtfsfeeds)