From 05235683072d0610236e983a5ff72e69c3cef0fd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 10 Jul 2022 21:22:52 +0100 Subject: [PATCH] Redo lynx unit test --- daemon.py | 3 --- tests.py | 8 +++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/daemon.py b/daemon.py index 71c5ebe00..60cfe2562 100644 --- a/daemon.py +++ b/daemon.py @@ -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 \ diff --git a/tests.py b/tests.py index 0d0831805..db7594936 100644 --- a/tests.py +++ b/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'