Merge pull request #5808 from goerz/pastebin
Fix "lexer" being used when uploading to bpaste.net
This commit is contained in:
commit
1675048b35
|
@ -0,0 +1 @@
|
||||||
|
Fix "lexer" being used when uploading to bpaste.net from ``--pastebin`` to "text".
|
|
@ -65,7 +65,7 @@ def create_new_paste(contents):
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
params = {"code": contents, "lexer": "python3", "expiry": "1week"}
|
params = {"code": contents, "lexer": "text", "expiry": "1week"}
|
||||||
url = "https://bpaste.net"
|
url = "https://bpaste.net"
|
||||||
try:
|
try:
|
||||||
response = (
|
response = (
|
||||||
|
|
|
@ -165,7 +165,7 @@ class TestPaste:
|
||||||
assert len(mocked_urlopen) == 1
|
assert len(mocked_urlopen) == 1
|
||||||
url, data = mocked_urlopen[0]
|
url, data = mocked_urlopen[0]
|
||||||
assert type(data) is bytes
|
assert type(data) is bytes
|
||||||
lexer = "python3"
|
lexer = "text"
|
||||||
assert url == "https://bpaste.net"
|
assert url == "https://bpaste.net"
|
||||||
assert "lexer=%s" % lexer in data.decode()
|
assert "lexer=%s" % lexer in data.decode()
|
||||||
assert "code=full-paste-contents" in data.decode()
|
assert "code=full-paste-contents" in data.decode()
|
||||||
|
|
Loading…
Reference in New Issue