Files
POC-Java-www/pocwww/tests.py
2017-03-09 18:12:18 -06:00

30 lines
708 B
Python

import unittest
from pyramid import testing
class ViewTests(unittest.TestCase):
def setUp(self):
self.config = testing.setUp()
def tearDown(self):
testing.tearDown()
def test_my_view(self):
from .views import my_view
request = testing.DummyRequest()
info = my_view(request)
self.assertEqual(info['project'], 'POC Web Interface')
class FunctionalTests(unittest.TestCase):
def setUp(self):
from pocwww import main
app = main({})
from webtest import TestApp
self.testapp = TestApp(app)
def test_root(self):
res = self.testapp.get('/', status=200)
self.assertTrue(b'Pyramid' in res.body)