# Path: habitat/views/payload_telemetry.py
# def _check_only_new(new, old):
# def _is_equal_relaxed_floats(a, b):
# def validate(new, old, userctx, secobj):
# def _estimate_time_received(receivers):
# def flight_payload_time_map(doc):
# def payload_time_map(doc):
# def time_map(doc):
# def add_listener_update(doc, req):
# def http_post_update(doc, req):
# 
# 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 payload_telemetry
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 json
import mox
# habitat is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with habitat.  If not, see <http://www.gnu.org/licenses/>.

"""
Tests payload_telemetry document views and functions.
"""





doc = {
    "_id": "54e9ac9ec19a57d6828a737525e3cc792743a16344b1c69dfe1562620b0fac9b",
    "type": "payload_telemetry",
    "data": {
        "_raw": "ABCDEF=="
    },
    "receivers": {
        "M0RND": {
            "time_created": "2012-07-17T21:03:26+01:00",
            "time_uploaded": "2012-07-17T21:03:29+01:00"
        }
    }
}


# Path: habitat/views/payload_telemetry.py
# def _check_only_new(new, old):
# def _is_equal_relaxed_floats(a, b):
# def validate(new, old, userctx, secobj):
# def _estimate_time_received(receivers):
# def flight_payload_time_map(doc):
# def payload_time_map(doc):
# def time_map(doc):
# def add_listener_update(doc, req):
# def http_post_update(doc, req):
# 
# 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_payload_telemetry.py
from ...views import payload_telemetry
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 json
import mox

# habitat is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with habitat.  If not, see <http://www.gnu.org/licenses/>.

"""
Tests payload_telemetry document views and functions.
"""





doc = {
    "_id": "54e9ac9ec19a57d6828a737525e3cc792743a16344b1c69dfe1562620b0fac9b",
    "type": "payload_telemetry",
    "data": {
        "_raw": "ABCDEF=="
    },
    "receivers": {
        "M0RND": {
            "time_created": "2012-07-17T21:03:26+01:00",
            "time_uploaded": "2012-07-17T21:03:29+01:00"
        }
    }
}


schema = read_json_schema("payload_telemetry.json")