mirror of
https://github.com/ihabunek/toot.git
synced 2024-09-22 04:25:55 -04:00
Compare commits
2 Commits
4b17e2e586
...
1d48e64853
Author | SHA1 | Date | |
---|---|---|---|
|
1d48e64853 | ||
|
bf12dbff70 |
@ -41,6 +41,8 @@ TRUMPET = str(Path(__file__).parent.parent.parent / "trumpet.png")
|
|||||||
|
|
||||||
ASSETS_DIR = str(Path(__file__).parent.parent / "assets")
|
ASSETS_DIR = str(Path(__file__).parent.parent / "assets")
|
||||||
|
|
||||||
|
PASSWORD = "83dU29170rjKilKQQwuWhJv3PKnSW59bWx0perjP6i7Nu4rkeh4mRfYuvVLYM3fM"
|
||||||
|
|
||||||
|
|
||||||
def create_app(base_url):
|
def create_app(base_url):
|
||||||
instance = api.get_instance(base_url).json()
|
instance = api.get_instance(base_url).json()
|
||||||
@ -52,7 +54,7 @@ def register_account(app: App):
|
|||||||
username = str(uuid.uuid4())[-10:]
|
username = str(uuid.uuid4())[-10:]
|
||||||
email = f"{username}@example.com"
|
email = f"{username}@example.com"
|
||||||
|
|
||||||
response = api.register_account(app, username, email, "password", "en")
|
response = api.register_account(app, username, email, PASSWORD, "en")
|
||||||
return User(app.instance, username, response["access_token"])
|
return User(app.instance, username, response["access_token"])
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ from unittest import mock
|
|||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
from toot import User, cli
|
from toot import User, cli
|
||||||
from tests.integration.conftest import Run
|
from tests.integration.conftest import PASSWORD, Run
|
||||||
|
|
||||||
# TODO: figure out how to test login
|
# TODO: figure out how to test login
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ def test_login_cli(
|
|||||||
cli.auth.login_cli,
|
cli.auth.login_cli,
|
||||||
"--instance", "http://localhost:3000",
|
"--instance", "http://localhost:3000",
|
||||||
"--email", f"{user.username}@example.com",
|
"--email", f"{user.username}@example.com",
|
||||||
"--password", "password",
|
"--password", PASSWORD,
|
||||||
)
|
)
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert "✓ Successfully logged in." in result.stdout
|
assert "✓ Successfully logged in." in result.stdout
|
||||||
|
@ -327,8 +327,10 @@ class TUI(urwid.Frame):
|
|||||||
# get the major version number of the server
|
# get the major version number of the server
|
||||||
# this works for Mastodon and Pleroma version strings
|
# this works for Mastodon and Pleroma version strings
|
||||||
# Mastodon versions < 4 do not have translation service
|
# Mastodon versions < 4 do not have translation service
|
||||||
|
# If the version is missing, assume 0 as a fallback
|
||||||
# Revisit this logic if Pleroma implements translation
|
# Revisit this logic if Pleroma implements translation
|
||||||
ch = instance["version"][0]
|
version = instance["version"]
|
||||||
|
ch = "0" if not version else version[0]
|
||||||
self.can_translate = int(ch) > 3 if ch.isnumeric() else False
|
self.can_translate = int(ch) > 3 if ch.isnumeric() else False
|
||||||
|
|
||||||
return self.run_in_thread(_load_instance, done_callback=_done)
|
return self.run_in_thread(_load_instance, done_callback=_done)
|
||||||
|
Loading…
Reference in New Issue
Block a user