/usr/lib/python2.7/dist-packages/pyramid_jinja2/demo/tests.py is in python-pyramid-jinja2 2.7+dfsg-1.
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 | import unittest
import pyramid.testing
class DemoTests(unittest.TestCase):
def test_root_view(self):
from pyramid_jinja2.demo import root_view
m = pyramid.testing.DummyRequest()
root_view(m)
self.assertEqual(m.locale_name, 'fr')
def test_app(self):
from pyramid_jinja2.demo import app
webapp = app({})
self.assertTrue(callable(webapp))
def test_main(self):
from pyramid_jinja2.demo import Mainer
class MyMainer(Mainer):
def serve_forever(self):
self.serving = True
def make_server(self, *args, **kwargs):
return Mock(args=args,
kwargs=kwargs,
serve_forever=self.serve_forever)
mainer = MyMainer()
mainer.main()
self.assertTrue(getattr(mainer, 'serving', False))
class Mock(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
|