/usr/lib/python3/dist-packages/pydap/tests/test_responses_version.py is in python3-pydap 3.2.2+ds1-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | """Test the version response."""
import unittest
from webtest import TestApp as App
from pydap.lib import __version__
from pydap.handlers.lib import BaseHandler
from pydap.tests.datasets import VerySimpleSequence
class TestVersionResponse(unittest.TestCase):
"""Simple tests for the version response.
Here we don't test the actual response body, since it will vary from
system to system and breaks continuous integration.
"""
def setUp(self):
"""Create a simple WSGI app with a dataset."""
app = App(BaseHandler(VerySimpleSequence))
self.res = app.get('/.ver')
def test_status(self):
"""Test the status code."""
self.assertEqual(self.res.status, "200 OK")
def test_content_type(self):
"""Test that content-type is correctly set."""
self.assertEqual(self.res.content_type, "application/json")
def test_charset(self):
"""Test that charset is correctly set."""
self.assertEqual(self.res.charset, "utf-8")
def test_headers(self):
"""Test that all headers are present."""
self.assertEqual(self.res.headers['Content-Type'],
'application/json; charset=utf-8')
self.assertEqual(self.res.headers['Content-description'],
'dods_version')
self.assertEqual(self.res.headers['XDODS-Server'],
'pydap/' + __version__)
|