fix tests

This commit is contained in:
posativ 2012-12-16 00:31:55 +01:00
parent a4514e1f91
commit 63b990838d
2 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ def get(app, environ, request, path, id=None):
rv = list(app.db.retrieve(path)) if id is None else app.db.get(path, id)
if not rv:
return 400, '', {}
return 404, '', {}
if request.args.get('plain', '0') == '0':
if isinstance(rv, list):

View File

@ -56,7 +56,7 @@ class TestComments(unittest.TestCase):
for i in range(20):
self.post('/1.0/path/new', data=json.dumps(comment(text='Spam')))
r = self.get('/1.0/path/')
r = self.get('/1.0/path')
assert r.status_code == 200
rv = json.loads(r.data)
@ -113,7 +113,7 @@ class TestComments(unittest.TestCase):
data=json.dumps(comment(text='...'))).status_code == 201
for path in paths:
assert self.get('/1.0/' + path + '/').status_code == 200
assert self.get('/1.0/' + path).status_code == 200
assert self.get('/1.0/' + path + '/1').status_code == 200
def testDeleteAndCreateByDifferentUsersButSamePostId(self):