Tests: Added rootfs tests.

This commit is contained in:
Tiago Natel de Moura
2020-05-28 14:59:52 +01:00
parent e2b53e16c6
commit 08b765ae42
12 changed files with 542 additions and 34 deletions

View File

@@ -0,0 +1,31 @@
import json
import os
try:
# Python 3
from urllib.parse import parse_qs
except ImportError:
# Python 2
from urlparse import parse_qs
def application(environ, start_response):
ret = {
'FileExists': False,
}
d = parse_qs(environ['QUERY_STRING'])
ret['FileExists'] = os.path.exists(d.get('path')[0])
out = json.dumps(ret)
start_response(
'200',
[
('Content-Type', 'application/json'),
('Content-Length', str(len(out))),
],
)
return out.encode('utf-8')