Fix flast wiring test

This commit is contained in:
Roman Mogylatov 2021-09-30 19:32:18 -04:00
parent 98f036e14c
commit 0b1e214135

View File

@ -1,17 +1,18 @@
import unittest import unittest
import json
# Runtime import to avoid syntax errors in samples on Python < 3.5 and reach top-dir # Runtime import to avoid syntax errors in samples on Python < 3.5 and reach top-dir
import os import os
_TOP_DIR = os.path.abspath( _TOP_DIR = os.path.abspath(
os.path.sep.join(( os.path.sep.join((
os.path.dirname(__file__), os.path.dirname(__file__),
'../', "../",
)), )),
) )
_SAMPLES_DIR = os.path.abspath( _SAMPLES_DIR = os.path.abspath(
os.path.sep.join(( os.path.sep.join((
os.path.dirname(__file__), os.path.dirname(__file__),
'../samples/', "../samples/",
)), )),
) )
import sys import sys
@ -27,7 +28,7 @@ class WiringFlaskTest(unittest.TestCase):
client = web.app.test_client() client = web.app.test_client()
with web.app.app_context(): with web.app.app_context():
response = client.get('/') response = client.get("/")
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertEqual(response.data, b'{"result":"Ok"}\n') self.assertEqual(json.loads(response.data), {"result": "Ok"})