MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_create_new_paste

Method test_create_new_paste

testing/test_pastebin.py:162–172  ·  view source on GitHub ↗
(self, pastebin, mocked_urlopen)

Source from the content-addressed store, hash-verified

160 assert len(mocked_urlopen_fail) == 1
161
162 def test_create_new_paste(self, pastebin, mocked_urlopen) -> None:
163 result = pastebin.create_new_paste(b"full-paste-contents")
164 assert result == "https://bpa.st/show/3c0c6750bd"
165 assert len(mocked_urlopen) == 1
166 url, data = mocked_urlopen[0]
167 assert type(data) is bytes
168 lexer = "text"
169 assert url == "https://bpa.st"
170 assert "lexer=%s" % lexer in data.decode()
171 assert "code=full-paste-contents" in data.decode()
172 assert "expiry=1week" in data.decode()
173
174 def test_create_new_paste_failure(self, pastebin, monkeypatch: MonkeyPatch) -> None:
175 import io

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected