# test_app.py
import sys
import os

# Write to debug log
debug_file = '/home/synzhico/logs/test_debug.log'
with open(debug_file, 'w') as f:
    f.write(f"test_app.py is running!\n")
    f.write(f"Python: {sys.version}\n")
    f.write(f"Directory: {os.getcwd()}\n")
    f.write(f"Files: {os.listdir('.')}\n")

def application(environ, start_response):
    status = '200 OK'
    output = b'test_app.py is working!'
    response_headers = [('Content-type', 'text/plain'),
                        ('Content-Length', str(len(output)))]
    start_response(status, response_headers)
    return [output]
