File tree Expand file tree Collapse file tree 4 files changed +4
-6
lines changed
Expand file tree Collapse file tree 4 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 1414
1515from flask import Flask , render_template , request
1616import os
17- import sys
1817
1918import render
2019
Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515import main
16- import os
1716import pytest
1817
1918
@@ -32,11 +31,12 @@ def test_editor_handler(client):
3231 assert "<title>Markdown Editor</title>" in body
3332 assert "This UI allows a user to write Markdown text" in body
3433
34+
3535def test_render_handler_errors (client ):
3636 r = client .get ("/render" )
3737 assert r .status_code == 405
3838
3939 with pytest .raises (Exception ) as e :
4040 client .post ("/render" , data = "**markdown**" )
4141
42- assert "Invalid JSON" in str (e .value )
42+ assert "Invalid JSON" in str (e .value )
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def new_request(data):
2727
2828 url = os .environ .get ("EDITOR_UPSTREAM_RENDER_URL" )
2929 unauthenticated = os .environ .get ("EDITOR_UPSTREAM_UNAUTHENTICATED" , False )
30-
30+
3131 req = urllib .request .Request (url , data = data .encode ())
3232
3333 if not unauthenticated :
Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515import main
16- import os
1716import pytest
1817
1918
@@ -39,4 +38,4 @@ def test_markdown_handler(client):
3938 )
4039 r = client .post ("/" , data = data_input )
4140 assert r .status_code == 200
42- assert expect in r .data .decode ()
41+ assert expect in r .data .decode ()
You can’t perform that action at this time.
0 commit comments