mirror of
https://github.com/ihabunek/toot.git
synced 2024-11-03 04:17:21 -05:00
Fix tests for follow/unfollow
This commit is contained in:
parent
9b48432d04
commit
12047cdc92
@ -3,7 +3,7 @@ import pytest
|
|||||||
import requests
|
import requests
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from toot import console, User, App
|
from toot import console, User, App, ConsoleError
|
||||||
|
|
||||||
from tests.utils import MockResponse
|
from tests.utils import MockResponse
|
||||||
|
|
||||||
@ -218,10 +218,9 @@ def test_follow_not_found(monkeypatch, capsys):
|
|||||||
|
|
||||||
monkeypatch.setattr(requests, 'get', mock_get)
|
monkeypatch.setattr(requests, 'get', mock_get)
|
||||||
|
|
||||||
|
with pytest.raises(ConsoleError) as ex:
|
||||||
console.run_command(app, user, 'follow', ['blixa'])
|
console.run_command(app, user, 'follow', ['blixa'])
|
||||||
|
assert "Account not found" == str(ex.value)
|
||||||
out, err = capsys.readouterr()
|
|
||||||
assert "Account not found" in err
|
|
||||||
|
|
||||||
|
|
||||||
def test_unfollow(monkeypatch, capsys):
|
def test_unfollow(monkeypatch, capsys):
|
||||||
@ -265,10 +264,9 @@ def test_unfollow_not_found(monkeypatch, capsys):
|
|||||||
|
|
||||||
monkeypatch.setattr(requests, 'get', mock_get)
|
monkeypatch.setattr(requests, 'get', mock_get)
|
||||||
|
|
||||||
|
with pytest.raises(ConsoleError) as ex:
|
||||||
console.run_command(app, user, 'unfollow', ['blixa'])
|
console.run_command(app, user, 'unfollow', ['blixa'])
|
||||||
|
assert "Account not found" == str(ex.value)
|
||||||
out, err = capsys.readouterr()
|
|
||||||
assert "Account not found" in err
|
|
||||||
|
|
||||||
|
|
||||||
def test_whoami(monkeypatch, capsys):
|
def test_whoami(monkeypatch, capsys):
|
||||||
|
Loading…
Reference in New Issue
Block a user