# Path: src/mcsafetyfeed-server/mcsafetyfeedserver/models.py
# class Users(Base):
# class AgencyTypes(Base):
# class Agencies(Base):
# class DispatchTypes(Base):
# class Groups(Base):
# class GroupDispatchTypes(Base):
# class Statuses(Base):
# class Incidents(Base):
# class IncidentsDispatches(Base):
# class Dispatches(Base):
# class APICalls(Base):
# class CurrentDispatches(Base):
# class Runs(Base):
#     def get_from_code(cls, session, code):
#     def create_new_agency_type(cls, session, code, description):
#     def get_from_guid(cls, session, guid):
#     def create_new_agency(cls, session, agency_code, agency_name,
#             type_id, description, website):
#     def get_all(cls, session):
#     def get_from_dispatch_text(cls, session, dispatch_text):
#     def create_new_dispatch_type(cls, session, dispatch_text, description):
#     def get_all(cls, session):
#     def get_from_dispatch_text(cls, session, dispatch_text):
#     def create_new_status(cls, session, status_text, description):
#     def get_from_status_text(cls, session, status_text):
#     def create_new_incident(cls, session, dispatch_text):
#     def get_count(cls, session):
#     def check_exists(cls, session, guid, status_text):
#     def add_dispatch(cls, session, run_id, status_text, short_address,
#             guid, dispatch_text, dispatch_datetime, source_lat, source_lng,
#             geocode_lat, geocode_lng, full_address, geocode_successful):
#     def get_by_guid(cls, session, guid):
#     def close_dispatch(cls, session, run_id, guid):
#     def get_by_date(cls, session, target_datetime, start, count):
#     def get_count_by_date(cls, session, target_datetime):
#     def add_api_call(cls, session, api_key, query_time, api_call, api_version):
#     def get_count(cls, session):
#     def add_current_dispatch(cls, session, guid):
#     def get_current_dispatch_guids(cls, session):
#     def remove_current_dispatch(cls, session, guid):
#     def get_count(cls, session):
#     def new_run(cls, session):
#     def update_run(cls, session, run, successful, error_text, new_dispatches):


import unittest
import transaction
from pyramid import testing
from .models import DBSession
        from sqlalchemy import create_engine
        from .models import (
            Base,
            MyModel,
            )
        from .views import my_view
        from sqlalchemy import create_engine
        from .models import (
            Base,
            MyModel,
            )
        from .views import my_view




class TestMyViewSuccessCondition(unittest.TestCase):
    def setUp(self):
        self.config = testing.setUp()
        engine = create_engine('sqlite://')
        DBSession.configure(bind=engine)
        Base.metadata.create_all(engine)
        with transaction.manager:
            model = MyModel(name='one', value=55)
            DBSession.add(model)

    def tearDown(self):
        DBSession.remove()
        testing.tearDown()

    def test_passing_view(self):
        request = testing.DummyRequest()
        info = my_view(request)
        self.assertEqual(info['one'].name, 'one')
        self.assertEqual(info['project'], 'mcsafetyfeed-server')


class TestMyViewFailureCondition(unittest.TestCase):
    def setUp(self):
        self.config = testing.setUp()
        engine = create_engine('sqlite://')

# Path: src/mcsafetyfeed-server/mcsafetyfeedserver/models.py
# class Users(Base):
# class AgencyTypes(Base):
# class Agencies(Base):
# class DispatchTypes(Base):
# class Groups(Base):
# class GroupDispatchTypes(Base):
# class Statuses(Base):
# class Incidents(Base):
# class IncidentsDispatches(Base):
# class Dispatches(Base):
# class APICalls(Base):
# class CurrentDispatches(Base):
# class Runs(Base):
#     def get_from_code(cls, session, code):
#     def create_new_agency_type(cls, session, code, description):
#     def get_from_guid(cls, session, guid):
#     def create_new_agency(cls, session, agency_code, agency_name,
#             type_id, description, website):
#     def get_all(cls, session):
#     def get_from_dispatch_text(cls, session, dispatch_text):
#     def create_new_dispatch_type(cls, session, dispatch_text, description):
#     def get_all(cls, session):
#     def get_from_dispatch_text(cls, session, dispatch_text):
#     def create_new_status(cls, session, status_text, description):
#     def get_from_status_text(cls, session, status_text):
#     def create_new_incident(cls, session, dispatch_text):
#     def get_count(cls, session):
#     def check_exists(cls, session, guid, status_text):
#     def add_dispatch(cls, session, run_id, status_text, short_address,
#             guid, dispatch_text, dispatch_datetime, source_lat, source_lng,
#             geocode_lat, geocode_lng, full_address, geocode_successful):
#     def get_by_guid(cls, session, guid):
#     def close_dispatch(cls, session, run_id, guid):
#     def get_by_date(cls, session, target_datetime, start, count):
#     def get_count_by_date(cls, session, target_datetime):
#     def add_api_call(cls, session, api_key, query_time, api_call, api_version):
#     def get_count(cls, session):
#     def add_current_dispatch(cls, session, guid):
#     def get_current_dispatch_guids(cls, session):
#     def remove_current_dispatch(cls, session, guid):
#     def get_count(cls, session):
#     def new_run(cls, session):
#     def update_run(cls, session, run, successful, error_text, new_dispatches):


# Path: src/mcsafetyfeed-server/mcsafetyfeedserver/tests.py
import unittest
import transaction
from pyramid import testing
from .models import DBSession
        from sqlalchemy import create_engine
        from .models import (
            Base,
            MyModel,
            )
        from .views import my_view
        from sqlalchemy import create_engine
        from .models import (
            Base,
            MyModel,
            )
        from .views import my_view





class TestMyViewSuccessCondition(unittest.TestCase):
    def setUp(self):
        self.config = testing.setUp()
        engine = create_engine('sqlite://')
        DBSession.configure(bind=engine)
        Base.metadata.create_all(engine)
        with transaction.manager:
            model = MyModel(name='one', value=55)
            DBSession.add(model)

    def tearDown(self):
        DBSession.remove()
        testing.tearDown()

    def test_passing_view(self):
        request = testing.DummyRequest()
        info = my_view(request)
        self.assertEqual(info['one'].name, 'one')
        self.assertEqual(info['project'], 'mcsafetyfeed-server')


class TestMyViewFailureCondition(unittest.TestCase):
    def setUp(self):
        self.config = testing.setUp()
        engine = create_engine('sqlite://')

        DBSession.configure(bind=engine)