
Story: 2008529 Task: 41688 Signed-off-by: Bin Yang <bin.yang@windriver.com> Change-Id: Ib276520605cc624a9976f804a1721ba2c5909403
23 lines
699 B
Python
23 lines
699 B
Python
from unittest import TestCase
|
|
from webtest import TestApp
|
|
from notificationclient.tests import FunctionalTest
|
|
|
|
|
|
class TestRootController(FunctionalTest):
|
|
|
|
def test_get(self):
|
|
response = self.app.get('/')
|
|
assert response.status_int == 200
|
|
|
|
def test_search(self):
|
|
response = self.app.post('/', params={'q': 'RestController'})
|
|
assert response.status_int == 302
|
|
assert response.headers['Location'] == (
|
|
'https://pecan.readthedocs.io/en/latest/search.html'
|
|
'?q=RestController'
|
|
)
|
|
|
|
def test_get_not_found(self):
|
|
response = self.app.get('/a/bogus/url', expect_errors=True)
|
|
assert response.status_int == 404
|