import pytest import cherrypy from tests.lib import * # NOQA - fixtures class PhotolibTestExample(PhotolibTest): def test_index(self): """ Tests that the '/' url returns a redirect to '/feed' """ self.getPage("/") self.assertStatus('302 Found') self.assertHeaderEndsWith('Location', '/feed') class PhotolibTestApi(PhotolibTest): def test_photos(self): self.getPage("/api/v1/photos") self.assertStatus('200 OK') def test_byhash(self): self.getPage("/api/v1/byhash?sha=lol") self.assertStatus('404 Not Found') # self.assertBody('Hello world') # self.assertHeader('Content-Type', 'text/html;charset=utf-8') # self.getPage("/echo?message=A+bient%F4t", # headers=[ # ('Accept-Charset', 'ISO-8859-1,utf-8'), # ('Content-Type', 'text/html;charset=ISO-8859-1') # ] # )