Skip to content

Commit

Permalink
test: 重命名测试文件夹名与源代码中的命名保持一致 (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 authored Dec 8, 2024
1 parent 8c9c899 commit 5ccc47d
Show file tree
Hide file tree
Showing 73 changed files with 47 additions and 50 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from nonebug import App
from pytest_mock import MockerFixture

from tests.github.event import get_mock_event
from tests.github.utils import get_github_bot
from tests.plugins.github.event import get_mock_event
from tests.plugins.github.utils import get_github_bot


def get_issue_labels(labels: list[str]):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from pytest_mock import MockerFixture
from respx import MockRouter

from tests.github.config.utils import generate_issue_body
from tests.github.event import get_mock_event
from tests.github.utils import (
from tests.plugins.github.config.utils import generate_issue_body
from tests.plugins.github.event import get_mock_event
from tests.plugins.github.utils import (
MockIssue,
check_json_data,
get_github_bot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from nonebug import App
from pytest_mock import MockerFixture

from tests.github.config.utils import generate_issue_body
from tests.github.event import get_mock_event
from tests.github.utils import (
from tests.plugins.github.config.utils import generate_issue_body
from tests.plugins.github.event import get_mock_event
from tests.plugins.github.utils import (
MockIssue,
get_github_bot,
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from nonebug import App
from pytest_mock import MockerFixture

from tests.github.utils import check_json_data
from tests.plugins.github.utils import check_json_data


async def test_update_file(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from nonebug import App
from pytest_mock import MockerFixture

from tests.github.event import get_mock_event
from tests.github.utils import get_github_bot
from tests.plugins.github.event import get_mock_event
from tests.plugins.github.utils import get_github_bot


async def test_auto_merge(app: App, mocker: MockerFixture, mock_installation) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from pytest_mock import MockerFixture
from respx import MockRouter

from tests.github.event import get_mock_event
from tests.github.utils import (
from tests.plugins.github.event import get_mock_event
from tests.plugins.github.utils import (
MockBody,
MockIssue,
check_json_data,
Expand Down Expand Up @@ -1445,8 +1445,8 @@ async def test_process_publish_check_not_pass(
["git", "config", "--global", "safe.directory", "*"],
check=True,
capture_output=True,
),
] # type: ignore
), # type: ignore
]
)

# 检查文件是否正确
Expand Down Expand Up @@ -1515,8 +1515,8 @@ async def test_issue_state_closed(
["git", "config", "--global", "safe.directory", "*"],
check=True,
capture_output=True,
),
] # type: ignore
), # type: ignore
]
)


Expand Down Expand Up @@ -1808,8 +1808,8 @@ async def test_skip_plugin_check(
["git", "config", "--global", "safe.directory", "*"],
check=True,
capture_output=True,
),
] # type: ignore
), # type: ignore
]
)

# 检查文件是否正确
Expand Down Expand Up @@ -1941,8 +1941,8 @@ async def test_convert_pull_request_to_draft(
["git", "config", "--global", "safe.directory", "*"],
check=True,
capture_output=True,
),
] # type: ignore
), # type: ignore
]
)

# 检查文件是否正确
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from pytest_mock import MockerFixture
from respx import MockRouter

from tests.github.event import get_mock_event
from tests.github.utils import (
from tests.plugins.github.event import get_mock_event
from tests.plugins.github.utils import (
MockBody,
MockIssue,
MockUser,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from nonebug import App
from pytest_mock import MockerFixture

from tests.github.utils import get_github_bot
from tests.plugins.github.utils import get_github_bot


async def test_comment_issue(app: App, mocker: MockerFixture):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from nonebug import App
from pytest_mock import MockerFixture

from tests.github.utils import MockIssue, get_github_bot
from tests.plugins.github.utils import MockIssue, get_github_bot


async def test_ensure_issue_content(app: App, mocker: MockerFixture):
Expand All @@ -17,7 +17,6 @@ async def test_ensure_issue_content(app: App, mocker: MockerFixture):
bot=bot,
repo_info=RepoInfo(owner="owner", repo="repo"),
issue=issue.as_mock(mocker),
issue_number=issue.number,
)

ctx.should_call_api(
Expand Down Expand Up @@ -61,7 +60,6 @@ async def test_ensure_issue_content_partial(app: App, mocker: MockerFixture):
bot=bot,
repo_info=RepoInfo(owner="owner", repo="repo"),
issue=issue.as_mock(mocker),
issue_number=issue.number,
)

ctx.should_call_api(
Expand Down Expand Up @@ -93,7 +91,6 @@ async def test_ensure_issue_content_complete(app: App, mocker: MockerFixture):
bot=bot,
repo_info=RepoInfo(owner="owner", repo="repo"),
issue=issue.as_mock(mocker),
issue_number=issue.number,
)

await ensure_issue_content(handler)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from nonebug import App
from pytest_mock import MockerFixture

from tests.github.utils import MockBody, MockIssue, get_github_bot
from tests.plugins.github.utils import MockBody, MockIssue, get_github_bot


async def test_ensure_issue_plugin_test_button(app: App, mocker: MockerFixture):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from nonebug import App
from pytest_mock import MockerFixture

from tests.github.utils import get_github_bot
from tests.plugins.github.utils import get_github_bot


async def test_get_pull_requests_by_label(app: App, mocker: MockerFixture) -> None:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pytest_mock import MockerFixture
from respx import MockRouter

from tests.github.utils import (
from tests.plugins.github.utils import (
MockBody,
MockIssue,
MockUser,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pytest_mock import MockerFixture
from respx import MockRouter

from tests.github.utils import (
from tests.plugins.github.utils import (
MockBody,
MockIssue,
generate_issue_body_plugin_skip_test,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pytest_mock import MockerFixture
from respx import MockRouter

from tests.github.utils import (
from tests.plugins.github.utils import (
generate_issue_body_adapter,
generate_issue_body_bot,
generate_issue_body_plugin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from nonebug import App
from pytest_mock import MockerFixture

from tests.github.event import get_mock_event
from tests.github.utils import get_github_bot
from tests.plugins.github.event import get_mock_event
from tests.plugins.github.utils import get_github_bot


def get_issue_labels(labels: list[str]):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from pytest_mock import MockerFixture
from respx import MockRouter

from tests.github.event import get_mock_event
from tests.github.utils import (
from tests.plugins.github.event import get_mock_event
from tests.plugins.github.utils import (
MockIssue,
MockUser,
check_json_data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from nonebug import App
from pytest_mock import MockerFixture

from tests.github.event import get_mock_event
from tests.github.utils import (
from tests.plugins.github.event import get_mock_event
from tests.plugins.github.utils import (
MockIssue,
generate_issue_body_remove,
get_github_bot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pytest_mock import MockerFixture
from respx import MockRouter

from tests.github.utils import (
from tests.plugins.github.utils import (
MockIssue,
MockUser,
check_json_data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pytest_mock import MockerFixture
from respx import MockRouter

from tests.github.utils import check_json_data
from tests.plugins.github.utils import check_json_data


async def test_update_file(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from inline_snapshot import snapshot
from respx import MockRouter

from tests.utils.validation.utils import generate_bot_data
from tests.providers.validation.utils import generate_bot_data


async def test_homepage_failed_http_exception(mocked_api: MockRouter) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from inline_snapshot import snapshot
from respx import MockRouter

from tests.utils.validation.utils import generate_plugin_data
from tests.providers.validation.utils import generate_plugin_data


async def test_fields_missing_plugin(mocked_api: MockRouter) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from inline_snapshot import snapshot
from respx import MockRouter

from tests.utils.validation.utils import generate_adapter_data
from tests.providers.validation.utils import generate_adapter_data


async def test_name_too_long(mocked_api: MockRouter) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from inline_snapshot import snapshot
from respx import MockRouter

from tests.utils.validation.utils import generate_plugin_data
from tests.providers.validation.utils import generate_plugin_data


async def test_plugin_supported_adapters_none(mocked_api: MockRouter) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from inline_snapshot import snapshot
from respx import MockRouter

from tests.utils.validation.utils import generate_adapter_data
from tests.providers.validation.utils import generate_adapter_data


async def test_project_link_invalid(mocked_api: MockRouter) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from inline_snapshot import snapshot
from respx import MockRouter

from tests.utils.validation.utils import generate_plugin_data
from tests.providers.validation.utils import generate_plugin_data


async def test_tags_color_missing(mocked_api: MockRouter) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from inline_snapshot import snapshot
from respx import MockRouter

from tests.utils.validation.utils import generate_adapter_data
from tests.providers.validation.utils import generate_adapter_data


async def test_adapter_info_validation_success(mocked_api: MockRouter) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from inline_snapshot import snapshot
from respx import MockRouter

from tests.utils.validation.utils import generate_bot_data
from tests.providers.validation.utils import generate_bot_data


async def test_bot_info_validation_success(mocked_api: MockRouter) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from inline_snapshot import snapshot
from respx import MockRouter

from tests.utils.validation.utils import generate_plugin_data
from tests.providers.validation.utils import generate_plugin_data


async def test_plugin_info_validation_success(mocked_api: MockRouter) -> None:
Expand Down
File renamed without changes.

0 comments on commit 5ccc47d

Please sign in to comment.