mirror of
https://github.com/ihabunek/toot.git
synced 2024-09-29 04:35:54 -04:00
Move Run type alias to conftest
It's only used in tests
This commit is contained in:
parent
84e75347e0
commit
3a147a5ea0
@ -14,10 +14,11 @@ export TOOT_TEST_DATABASE_DSN="dbname=mastodon_development"
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import re
|
|
||||||
import os
|
import os
|
||||||
import psycopg2
|
import psycopg2
|
||||||
import pytest
|
import pytest
|
||||||
|
import re
|
||||||
|
import typing as t
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from click.testing import CliRunner, Result
|
from click.testing import CliRunner, Result
|
||||||
@ -31,6 +32,9 @@ def pytest_configure(config):
|
|||||||
toot.settings.DISABLE_SETTINGS = True
|
toot.settings.DISABLE_SETTINGS = True
|
||||||
|
|
||||||
|
|
||||||
|
# Type alias for run commands
|
||||||
|
Run = t.Callable[..., Result]
|
||||||
|
|
||||||
# Mastodon database name, used to confirm user registration without having to click the link
|
# Mastodon database name, used to confirm user registration without having to click the link
|
||||||
DATABASE_DSN = os.getenv("TOOT_TEST_DATABASE_DSN")
|
DATABASE_DSN = os.getenv("TOOT_TEST_DATABASE_DSN")
|
||||||
TOOT_TEST_BASE_URL = os.getenv("TOOT_TEST_BASE_URL")
|
TOOT_TEST_BASE_URL = os.getenv("TOOT_TEST_BASE_URL")
|
||||||
|
@ -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 toot.cli import Run
|
from tests.integration.conftest import Run
|
||||||
|
|
||||||
# TODO: figure out how to test login
|
# TODO: figure out how to test login
|
||||||
|
|
||||||
|
@ -39,10 +39,6 @@ DURATION_EXAMPLES = """e.g. "1 day", "2 hours 30 minutes", "5 minutes 30
|
|||||||
seconds" or any combination of above. Shorthand: "1d", "2h30m", "5m30s\""""
|
seconds" or any combination of above. Shorthand: "1d", "2h30m", "5m30s\""""
|
||||||
|
|
||||||
|
|
||||||
# Type alias for run commands
|
|
||||||
Run = t.Callable[..., Result]
|
|
||||||
|
|
||||||
|
|
||||||
def get_default_visibility() -> str:
|
def get_default_visibility() -> str:
|
||||||
return os.getenv("TOOT_POST_VISIBILITY", "public")
|
return os.getenv("TOOT_POST_VISIBILITY", "public")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user