File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -48,3 +48,29 @@ def test_ofmt_term(client):
4848 assert rv .status_code == 200
4949 assert rv .content_type .startswith ('text/plain' )
5050 assert rv .data == b"\x1b [32m+ 'b'\x1b [0m\n "
51+
52+
53+ def test_ofmt_html (client ):
54+ rv = client .post ('/api/v1/diff' , json = {
55+ 'a' : 'a' ,
56+ 'b' : 'b' ,
57+ 'diff_opts' : {'O' : False },
58+ 'ofmt' : 'html' ,
59+ })
60+
61+ assert rv .status_code == 200
62+ assert rv .content_type .startswith ('text/plain' )
63+ assert rv .data == b'<div class="nDvD"><div>+ <div class="nDvN">'b'</div></div></div>'
64+
65+
66+ def test_ofmt_unsupported (client ):
67+ rv = client .post ('/api/v1/diff' , json = {
68+ 'a' : 'a' ,
69+ 'b' : 'b' ,
70+ 'diff_opts' : {'O' : False },
71+ 'ofmt' : '__unsupported__' ,
72+ })
73+
74+ assert rv .status_code == 400
75+ assert rv .content_type .startswith ('text/html' )
76+ assert rv .data == b'Unsupported format __unsupported__'
You can’t perform that action at this time.
0 commit comments