Skip to content

Commit

Permalink
test: 将部分测试替换为新的 mock_datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
BigOrangeQWQ committed Jan 26, 2025
1 parent 6472e29 commit 418df00
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tests/plugins/github/config/utils/test_config_update_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ async def test_update_file(
mocker: MockerFixture,
tmp_path: Path,
mock_results: dict[str, Path],
mock_datetime,
) -> None:
from src.plugins.github.plugins.config.utils import update_file
from src.providers.constants import TIME_ZONE
from src.providers.validation.models import (
PluginPublishInfo,
PublishType,
Expand All @@ -26,11 +26,6 @@ async def test_update_file(
# 更改当前工作目录为临时目录
os.chdir(tmp_path)

mock_datetime = mocker.patch("src.providers.models.datetime")
mock_datetime.now.return_value = datetime(
2023, 8, 23, 9, 22, 14, 836035, tzinfo=TIME_ZONE
)

raw_data = {
"module_name": "nonebot_plugin_treehelp",
"project_link": "nonebot-plugin-treehelp",
Expand Down

0 comments on commit 418df00

Please sign in to comment.