-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_quick.py
More file actions
38 lines (31 loc) · 948 Bytes
/
Copy pathtest_quick.py
File metadata and controls
38 lines (31 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import sys
sys.path.insert(0, 'src/proxy')
from proxy import ProxyRequestHandler
print("=" * 70)
print("TEST: HTML Structure Tags Preservation")
print("=" * 70)
html = '<html><head><title>Test</title></head><body><h1>Hi</h1></body></html>'
# Create minimal handler instance
class FakeSocket:
def sendall(self, data): pass
def close(self): pass
class FakeServer:
pass
handler = ProxyRequestHandler(FakeSocket(), ('127.0.0.1', 0), FakeServer())
result = handler._sanitize_html(html, 'http://test.com')
print('\nINPUT:', html)
print('\nOUTPUT:', result)
print('\nSTRUCTURE CHECK:')
tags = ['<html', '<head', '<body', '<title']
all_ok = True
for t in tags:
if t in result:
print(f'✅ {t}> PRESERVED')
else:
print(f'❌ {t}> MISSING')
all_ok = False
print('\n' + '=' * 70)
if all_ok:
print('✅ SUCCESS - All structure tags preserved!')
else:
print('❌ FAILED - Some structure tags missing')