1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-06-30 06:35:24 +00:00
toot/tests/integration/test_accounts.py

29 lines
697 B
Python
Raw Normal View History

2023-11-18 14:00:39 +00:00
import json
from toot.entities import Account, from_dict
2023-03-30 08:56:03 +00:00
def test_whoami(user, run):
out = run("whoami")
# TODO: test other fields once updating account is supported
assert f"@{user.username}" in out
2023-11-18 14:00:39 +00:00
def test_whoami_json(user, run):
out = run("whoami", "--json")
account = from_dict(Account, json.loads(out))
assert account.username == user.username
2023-03-30 08:56:03 +00:00
def test_whois(app, friend, run):
variants = [
friend.username,
f"@{friend.username}",
f"{friend.username}@{app.instance}",
f"@{friend.username}@{app.instance}",
]
for username in variants:
out = run("whois", username)
assert f"@{friend.username}" in out