add failing test case for #111

This commit is contained in:
codl 2017-11-29 22:03:51 +01:00
pare 0f753e621a
commit 4d99e9316e
No se encontró ninguna clave conocida en la base de datos para esta firma
ID de clave GPG: 6CD7C8891ED1233A
S'han modificat 2 arxius amb 35 adicions i 1 eliminacions

Veure arxiu

@ -0,0 +1,29 @@
interactions:
- request:
body: !!python/unicode status=&visibility=
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
Connection: [keep-alive]
Content-Length: ['19']
Content-Type: [application/x-www-form-urlencoded]
User-Agent: [python-requests/2.18.4]
method: POST
uri: http://localhost:3000/api/v1/statuses
response:
body: {string: "{\"error\":\"\u30D0\u30EA\u30C7\u30FC\u30B7\u30E7\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F:
Text\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\"}"}
headers:
cache-control: [no-cache]
content-length: ['87']
content-type: [application/json; charset=utf-8]
transfer-encoding: [chunked]
vary: ['Accept-Encoding, Origin']
x-content-type-options: [nosniff]
x-frame-options: [SAMEORIGIN]
x-request-id: [b28457db-8446-42ac-b5a8-241d0a7434b4]
x-runtime: ['0.109104']
x-xss-protection: [1; mode=block]
status: {code: 422, message: Unprocessable Entity}
version: 1

Veure arxiu

@ -5,7 +5,12 @@ from time import sleep
@pytest.mark.vcr() @pytest.mark.vcr()
def test_status(status, api): def test_status(status, api):
status2 = api.status(status['id']) status2 = api.status(status['id'])
assert status2 == status assert status2
@pytest.mark.vcr()
def test_status_empty(api):
with pytest.raises(MastodonAPIError):
api.status_post('')
@pytest.mark.vcr() @pytest.mark.vcr()
def test_status_missing(api): def test_status_missing(api):