Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

# local imports, import after env loaded
from src.common import globals # noqa: E402
from src.discord import bot as d_bot # noqa: E402
from src.discord_bot import bot as d_bot # noqa: E402

Check warning on line 10 in src/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/__main__.py#L10

Added line #L10 was not covered by tests
from src.common import webapp # noqa: E402
from src.reddit import bot as r_bot # noqa: E402
from src.reddit_bot import bot as r_bot # noqa: E402

Check warning on line 12 in src/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/__main__.py#L12

Added line #L12 was not covered by tests


def main():
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/discord/bot.py → src/discord_bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# local imports
from src.common.common import bot_name, data_dir, get_avatar_bytes, org_name
from src.common.database import Database
from src.discord.views import DonateCommandView
from src.discord_bot.views import DonateCommandView


class Bot(discord.Bot):
Expand All @@ -23,7 +23,7 @@ class Bot(discord.Bot):
"""
def __init__(self, *args, **kwargs):
# tasks need to be imported here to avoid circular imports
from src.discord import tasks
from src.discord_bot import tasks

if 'intents' not in kwargs:
intents = discord.Intents.all()
Expand All @@ -43,7 +43,7 @@ def __init__(self, *args, **kwargs):
self.role_update_task = tasks.role_update_task

self.load_extension(
name='src.discord.cogs',
name='src.discord_bot.cogs',
recursive=True,
store=False,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

# local imports
from src.common.common import avatar, bot_name, colors, org_name, version
from src.discord.views import DonateCommandView
from src.discord import cogs_common
from src.discord_bot.views import DonateCommandView
from src.discord_bot import cogs_common


class BaseCommandsCog(discord.Cog):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

# local imports
from src.common.common import avatar, bot_name, colors
from src.discord.views import RefundCommandView
from src.discord import cogs_common
from src.discord_bot.views import RefundCommandView
from src.discord_bot import cogs_common


class FunCommandsCog(discord.Cog):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

# local imports
from src.common.common import avatar, bot_name, colors, data_dir
from src.discord.views import DocsCommandView
from src.discord import cogs_common
from src.discord_bot.views import DocsCommandView
from src.discord_bot import cogs_common


class SupportCommandsCog(discord.Cog):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/discord/tasks.py → src/discord_bot/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# local imports
from src.common.common import avatar, bot_name, bot_url, colors
from src.common import sponsors
from src.discord.bot import Bot
from src.discord.helpers import igdb_authorization, month_dictionary
from src.discord_bot.bot import Bot
from src.discord_bot.helpers import igdb_authorization, month_dictionary


@tasks.loop(seconds=30)
Expand Down
6 changes: 3 additions & 3 deletions src/discord/views.py → src/discord_bot/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

# local imports
from src.common.common import avatar, bot_name, colors
from src.discord.helpers import get_json
from src.discord.modals import RefundModal
from src.discord_bot.helpers import get_json
from src.discord_bot.modals import RefundModal


class DocsCommandDefaultProjects:
Expand Down Expand Up @@ -212,7 +212,7 @@
if select == self.children[0]: # chose the docs project
self.docs_version = None

complete, embed = self.check_completion_status()
_, embed = self.check_completion_status()

Check warning on line 215 in src/discord_bot/views.py

View check run for this annotation

Codecov / codecov/patch

src/discord_bot/views.py#L215

Added line #L215 was not covered by tests

await interaction.response.edit_message(embed=embed, view=self)

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
dotenv.load_dotenv(override=False) # environment secrets take priority over .env file

# import after env loaded
from src.discord import bot as d_bot # noqa: E402
from src.discord_bot import bot as d_bot # noqa: E402


@pytest.fixture(scope='session')
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/discord/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest

# local imports
from src.discord import tasks
from src.discord_bot import tasks


def set_env_variable(env_var_name, request):
Expand Down Expand Up @@ -98,7 +98,7 @@ async def test_daily_task(discord_bot, mocker, skip, set_daily_releases, set_dai
THEN check that the task runs without error
"""
# Patch datetime.datetime at the location where it's imported in `tasks`
mock_datetime = mocker.patch('src.discord.tasks.datetime', autospec=True)
mock_datetime = mocker.patch('src.discord_bot.tasks.datetime', autospec=True)
mock_datetime.now.return_value = datetime(2023, 1, 1, 1 if skip else 12, 0, 0, tzinfo=timezone.utc)

# Run the daily task
Expand All @@ -118,7 +118,7 @@ async def test_role_update_task(discord_bot, discord_db_users, mocker, skip):
THEN check that the task runs without error
"""
# Patch datetime.datetime at the location where it's imported in `tasks`
mock_datetime = mocker.patch('src.discord.tasks.datetime', autospec=True)
mock_datetime = mocker.patch('src.discord_bot.tasks.datetime', autospec=True)
mock_datetime.now.return_value = datetime(2023, 1, 1, 0, 1 if skip else 0, 0, tzinfo=timezone.utc)

# Run the task
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/reddit/test_reddit_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import pytest

# local imports
from src.reddit.bot import Bot
from src.reddit_bot.bot import Bot

Betamax.register_serializer(PrettyJSONSerializer)

Expand Down
Loading