summaryrefslogtreecommitdiff
path: root/tests/cgiapp_data/form.cgi
diff options
context:
space:
mode:
authorChris Dent <cdent@anticdent.org>2023-04-30 12:19:09 +0100
committerGitHub <noreply@github.com>2023-04-30 12:19:09 +0100
commit36fd9632d6ad880b24177a08435eb8e1f9b01714 (patch)
treee40622cf6a8167ea54c098a3db2361c6dab96b8c /tests/cgiapp_data/form.cgi
parent59eaf315d0e25ea8189e63d4f448d9808f8eb85d (diff)
downloadpaste-git-36fd9632d6ad880b24177a08435eb8e1f9b01714.tar.gz
Add github actions tests (#77)
Borrowing the configuration from wsg-intercept and then editing to fit so that we've got some automated tests. To get this to work it was necessary to: * adjust python versions * update action version * pin the ubuntu version * fix warning in test_grantip * form.cgi needs to not use six because it is not running in the virtualenv * quiet deprecations in in form.cgi because cgi module is deprecated * Skip the proxy test as it uses httpbin.org which is unreliable
Diffstat (limited to 'tests/cgiapp_data/form.cgi')
-rwxr-xr-xtests/cgiapp_data/form.cgi11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/cgiapp_data/form.cgi b/tests/cgiapp_data/form.cgi
index c4c562d..5ad8f68 100755
--- a/tests/cgiapp_data/form.cgi
+++ b/tests/cgiapp_data/form.cgi
@@ -2,13 +2,20 @@
from __future__ import print_function
+import sys
+
+# Quiet warnings in this CGI so that it does not upset tests.
+if not sys.warnoptions:
+ import warnings
+ warnings.simplefilter("ignore")
+
+# TODO: cgi is deprecated and will go away in Python 3.13.
import cgi
-import six
print('Content-type: text/plain')
print('')
-if six.PY3:
+if sys.version_info.major >= 3:
# Python 3: cgi.FieldStorage keeps some field names as unicode and some as
# the repr() of byte strings, duh.