|
|
|
@ -1,9 +1,8 @@
|
|
|
|
|
import pytest
|
|
|
|
|
import cherrypy
|
|
|
|
|
from tests.lib import * # NOQA - fixtures
|
|
|
|
|
import json
|
|
|
|
|
from tests.lib import PhotolibTest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PhotolibTestExample(PhotolibTest):
|
|
|
|
|
class PhotolibTestMisc(PhotolibTest):
|
|
|
|
|
def test_index(self):
|
|
|
|
|
"""
|
|
|
|
|
Tests that the '/' url returns a redirect to '/feed'
|
|
|
|
@ -11,27 +10,3 @@ class PhotolibTestExample(PhotolibTest):
|
|
|
|
|
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')
|
|
|
|
|
|
|
|
|
|
def test_user(self):
|
|
|
|
|
self.getPage("/api/v1/user")
|
|
|
|
|
self.assertStatus('200 OK')
|
|
|
|
|
|
|
|
|
|
# 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')
|
|
|
|
|
# ]
|
|
|
|
|
# )
|
|
|
|
|
|
|
|
|
|