mirror of https://gitlab.com/bashrc2/epicyon
Redo lynx unit test
parent
94ff176452
commit
0523568307
|
@ -4978,9 +4978,6 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
fields = \
|
||||
extract_text_fields_in_post(post_bytes, boundary, debug)
|
||||
|
||||
print('hashtag category POST bytes: ' + str(post_bytes))
|
||||
print('hashtag category POST fields: ' + str(fields))
|
||||
|
||||
if fields.get('hashtagCategory'):
|
||||
category_str = fields['hashtagCategory'].lower()
|
||||
if not is_blocked_hashtag(base_dir, category_str) and \
|
||||
|
|
8
tests.py
8
tests.py
|
@ -5855,12 +5855,14 @@ def _test_extract_text_fields_from_post():
|
|||
boundary = '--LYNX'
|
||||
form_data = '--LYNX\r\nContent-Disposition: form-data; ' + \
|
||||
'name="fieldName"\r\nContent-Type: text/plain; ' + \
|
||||
'charset=utf-8\r\n\r\nThis is a lynx test\r\n--LYNX\r\n' + \
|
||||
'Content-Disposition: form-data; name="submitYes"\r\n' + \
|
||||
'Content-Type: text/plain; charset=utf-8\r\n\r\nBUTTON\r\n--LYNX--\r\n'
|
||||
'charset=utf-8\r\n\r\nThis is a lynx test\r\n' + \
|
||||
'--LYNX\r\nContent-Disposition: ' + \
|
||||
'form-data; name="submitYes"\r\nContent-Type: text/plain; ' + \
|
||||
'charset=utf-8\r\n\r\nBUTTON\r\n--LYNX--\r\n'
|
||||
debug = True
|
||||
fields = extract_text_fields_in_post(None, boundary, debug, form_data)
|
||||
print('fields: ' + str(fields))
|
||||
assert fields
|
||||
assert fields['fieldName'] == 'This is a lynx test'
|
||||
assert fields['submitYes'] == 'BUTTON'
|
||||
|
||||
|
|
Loading…
Reference in New Issue