Skip to content
Snippets Groups Projects
Verified Commit f0e1504e authored by David Beniamine's avatar David Beniamine
Browse files

Working first test

parent f1b5ff40
No related branches found
No related tags found
No related merge requests found
import unittest
import json import json
from Mirador_backend import app from Mirador_backend.tests.tester import TestCase
class MiradorResourceTest(unittest.TestCase): class MiradorResourceTest(TestCase):
def setup(self): base = '/mirador_resource'
self.base = '/mirador_resource'
self.app = app.test_client
self.db = None # Todo
def testGet(self): def testGet(self):
# TODO payload
payload = json.dumps({}) payload = json.dumps({})
response = self.app.get(self.base + '/1', headers={"Content-Type": "application/json"}, data=payload) response = self.client.get(self.base + '/1', headers={"Content-Type": "application/json"}, data=payload)
self.assertEqual(200, response.status_code) self.assertEqual(200, response.status_code)
# TODO test actual behavior with fixture data
self.assertEqual('get', response.json['method']) self.assertEqual('get', response.json['method'])
self.assertEqual(str, type(response.json['id'])) self.assertEqual(int, type(response.json['id']))
import unittest
from Mirador_backend.app import app
class TestCase(unittest.TestCase):
def setUp(self):
self.base = '/mirador_resource'
self.app = app
app.testing = True
self.client = app.test_client()
# TODO DB, FS and fixtures
self.db = None
def tearDown(self):
# TODO
pass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment