28 lines
927 B
Python
28 lines
927 B
Python
import unittest
|
|
from server import app
|
|
|
|
class TestHnsauRoutes(unittest.TestCase):
|
|
def setUp(self):
|
|
app.config['TESTING'] = True
|
|
self.client = app.test_client()
|
|
|
|
def test_hnsau_home(self):
|
|
response = self.client.get('/', headers={'Host': 'hns.au'})
|
|
self.assertEqual(response.status_code, 200)
|
|
|
|
def test_hnsau_about_redirect(self):
|
|
response = self.client.get('/about', headers={'Host': 'hns.au'})
|
|
self.assertEqual(response.status_code, 302)
|
|
self.assertEqual(response.headers['Location'], '/#about')
|
|
|
|
def test_hnsau_pins(self):
|
|
response = self.client.get('/pins', headers={'Host': 'hns.au'})
|
|
self.assertEqual(response.status_code, 200)
|
|
|
|
def test_hnsau_links(self):
|
|
response = self.client.get('/links', headers={'Host': 'hns.au'})
|
|
self.assertEqual(response.status_code, 200)
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|