# Path: habitat/views/flight.py
# def validate(new, old, userctx, secobj):
# def end_start_including_payloads_map(doc):
# def launch_time_including_payloads_map(doc):
# def unapproved_name_including_payloads_map(doc):
# def all_name_map(doc):
# 
# Path: habitat/views/utils.py
# def read_json_schema(schemaname):
#     mypath = os.path.dirname(inspect.getfile(inspect.currentframe()))
#     path = os.path.join(mypath, "..", "..", "couchdb", "schemas", schemaname)
#     with open(path) as f:
#         schema = json.load(f)
#     return schema


from ...views import flight
from ...views.utils import read_json_schema
from couch_named_python import ForbiddenError, UnauthorizedError
from copy import deepcopy
from nose.tools import assert_raises
import mox
"""
Tests Flight document views and functions
"""





doc = {
    "_id": "fid",
    "type": "flight",
    "approved": False,
    "start": "2012-07-14T22:54:23+01:00",
    "end": "2012-07-15T00:00:00+01:00",
    "name": "Test Launch",
    "launch": {
        "time": "2012-07-14T23:30:00+01:00",
        "timezone": "Europe/London",
        "location": {
            "latitude": 12.345,
            "longitude": 54.321
        }
    }
}

schema = read_json_schema("flight.json")

class TestFlight(object):
    def setup(self):
        self.m = mox.Mox()

# Path: habitat/views/flight.py
# def validate(new, old, userctx, secobj):
# def end_start_including_payloads_map(doc):
# def launch_time_including_payloads_map(doc):
# def unapproved_name_including_payloads_map(doc):
# def all_name_map(doc):
# 
# Path: habitat/views/utils.py
# def read_json_schema(schemaname):
#     mypath = os.path.dirname(inspect.getfile(inspect.currentframe()))
#     path = os.path.join(mypath, "..", "..", "couchdb", "schemas", schemaname)
#     with open(path) as f:
#         schema = json.load(f)
#     return schema


# Path: habitat/tests/test_views/test_flight.py
from ...views import flight
from ...views.utils import read_json_schema
from couch_named_python import ForbiddenError, UnauthorizedError
from copy import deepcopy
from nose.tools import assert_raises
import mox

"""
Tests Flight document views and functions
"""





doc = {
    "_id": "fid",
    "type": "flight",
    "approved": False,
    "start": "2012-07-14T22:54:23+01:00",
    "end": "2012-07-15T00:00:00+01:00",
    "name": "Test Launch",
    "launch": {
        "time": "2012-07-14T23:30:00+01:00",
        "timezone": "Europe/London",
        "location": {
            "latitude": 12.345,
            "longitude": 54.321
        }
    }
}

schema = read_json_schema("flight.json")

class TestFlight(object):
    def setup(self):
        self.m = mox.Mox()

        self.m.StubOutWithMock(flight, 'validate_doc')