Your ROOT_URL in app.ini is https://source.parasitstudio.de:63000/ but you are visiting https://source.parasitstudio.de/wirtz/scriptform/commit/16c8d5818a81bf234f9ec99b53ebe8352c92da80?style=unified&whitespace=show-all
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
45 additions and
0 deletions
test/test.py
test/test_webapp_singleform.json
@ -323,6 +323,39 @@ class WebAppTest(unittest.TestCase):
self . assertEquals ( f_orig , f_served )
class WebAppSingleTest ( unittest . TestCase ) :
"""
Test that Scriptform doesn ' t show us a list of forms, but directly shows us
the form is there ' s only one.
"""
@classmethod
def setUpClass ( cls ) :
def server_thread ( sf ) :
sf . run ( listen_port = 8002 )
cls . sf = scriptform . ScriptForm ( ' test_webapp_singleform.json ' )
thread . start_new_thread ( server_thread , ( cls . sf , ) )
# Wait until the webserver is ready
while True :
time . sleep ( 0.1 )
if cls . sf . running :
break
@classmethod
def tearDownClass ( cls ) :
cls . sf . shutdown ( )
while True :
time . sleep ( 0.1 )
if not cls . sf . running :
break
def testSingleForm ( self ) :
"""
Ensure that Scriptform directly shows the form if there is only one .
"""
r = requests . get ( " http://localhost:8002/ " )
self . assertIn ( ' only_form ' , r . text )
if __name__ == ' __main__ ' :
logging . basicConfig ( level = logging . FATAL ,
format = ' %(asctime)s : %(name)s : %(levelname)s : %(message)s ' ,
@ -0,0 +1,12 @@
{
"title" : "single form test" ,
"forms" : [
{
"name" : "only_form" ,
"title" : "Only form" ,
"description" : "Only form" ,
"script" : "test.sh" ,
"fields" : [ ]
}
]
}