Fix "lexer" being used when uploading to bpaste.net

Closes #5806.
This commit is contained in:
Michael Goerz 2019-08-30 15:34:03 -04:00
parent 404cf0c872
commit f8dd6349c1
3 changed files with 3 additions and 2 deletions

View File

@ -0,0 +1 @@
Fix "lexer" being used when uploading to bpaste.net from ``--pastebin`` to "text".

View File

@ -65,7 +65,7 @@ def create_new_paste(contents):
from urllib.request import urlopen
from urllib.parse import urlencode
params = {"code": contents, "lexer": "python3", "expiry": "1week"}
params = {"code": contents, "lexer": "text", "expiry": "1week"}
url = "https://bpaste.net"
try:
response = (

View File

@ -165,7 +165,7 @@ class TestPaste:
assert len(mocked_urlopen) == 1
url, data = mocked_urlopen[0]
assert type(data) is bytes
lexer = "python3"
lexer = "text"
assert url == "https://bpaste.net"
assert "lexer=%s" % lexer in data.decode()
assert "code=full-paste-contents" in data.decode()