mirror of
https://github.com/ihabunek/toot
synced 2025-02-03 20:57:38 +01:00
Fix following tests
This commit is contained in:
parent
0cbb8863b3
commit
ee98ce3746
@ -95,24 +95,26 @@ def test_following_json(app: App, user: User, user_id, run_json):
|
|||||||
|
|
||||||
result = run_json(cli.accounts.follow, friend.username, "--json")
|
result = run_json(cli.accounts.follow, friend.username, "--json")
|
||||||
relationship = from_dict(Relationship, result)
|
relationship = from_dict(Relationship, result)
|
||||||
assert relationship.id == friend_id
|
|
||||||
assert relationship.following is True
|
assert relationship.following is True
|
||||||
|
|
||||||
[result] = run_json(cli.accounts.following, user.username, "--json")
|
[result] = run_json(cli.accounts.following, user.username, "--json")
|
||||||
relationship = from_dict(Relationship, result)
|
account = from_dict(Account, result)
|
||||||
assert relationship.id == friend_id
|
assert account.acct == friend.username
|
||||||
|
|
||||||
# If no account is given defaults to logged in user
|
# If no account is given defaults to logged in user
|
||||||
[result] = run_json(cli.accounts.following, user.username, "--json")
|
[result] = run_json(cli.accounts.following, "--json")
|
||||||
relationship = from_dict(Relationship, result)
|
account = from_dict(Account, result)
|
||||||
assert relationship.id == friend_id
|
assert account.acct == friend.username
|
||||||
|
|
||||||
|
assert relationship.following is True
|
||||||
|
|
||||||
[result] = run_json(cli.accounts.followers, friend.username, "--json")
|
[result] = run_json(cli.accounts.followers, friend.username, "--json")
|
||||||
assert result["id"] == user_id
|
account = from_dict(Account, result)
|
||||||
|
assert account.acct == user.username
|
||||||
|
|
||||||
result = run_json(cli.accounts.unfollow, friend.username, "--json")
|
result = run_json(cli.accounts.unfollow, friend.username, "--json")
|
||||||
assert result["id"] == friend_id
|
relationship = from_dict(Relationship, result)
|
||||||
assert result["following"] is False
|
assert relationship.following is False
|
||||||
|
|
||||||
result = run_json(cli.accounts.following, user.username, "--json")
|
result = run_json(cli.accounts.following, user.username, "--json")
|
||||||
assert result == []
|
assert result == []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user