Skip to content

Commit

Permalink
test_annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
emillon committed Oct 20, 2014
1 parent e4c2a9e commit 9732f7f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from flask.ext.uploads import TestingFileStorage
import re
import koremutake
import json


class TestCase(unittest.TestCase):
Expand Down Expand Up @@ -61,3 +62,17 @@ def test_no_doc(self):
self.assertEqual(r.status_code, 404)
r = self.app.get('/raw/0')
self.assertEqual(r.status_code, 404)

def test_annotation(self):
data = { 'doc': 1
, 'page': 2
, 'posx': 3
, 'posy': 4
, 'width': 5
, 'height': 6
, 'value': 'Oh oh'
}
r = self.app.post('/annotation/new', data=data)
self.assertEqual(r.status_code, 200)
d = json.loads(r.data)
self.assertIn('id', d)

0 comments on commit 9732f7f

Please sign in to comment.