style: 项目重构
1.项目改名为kilostar(千星) 2.后端部分进行大规模重构 3.node功能进行大规模重新设计
This commit is contained in:
@@ -2,8 +2,8 @@ import pytest
|
||||
from unittest.mock import patch
|
||||
from sqlalchemy.exc import IntegrityError, OperationalError
|
||||
from pydantic import ValidationError
|
||||
from pretor.utils.error import UserNotExistError
|
||||
from pretor.core.postgres_database import database_exception
|
||||
from kilostar.utils.error import UserNotExistError
|
||||
from kilostar.core.postgres_database import database_exception
|
||||
|
||||
|
||||
@database_exception
|
||||
@@ -42,7 +42,7 @@ async def test_success_func():
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@patch("pretor.core.database.database_exception.logger")
|
||||
@patch("kilostar.core.database.database_exception.logger")
|
||||
async def test_validation_error(mock_logger):
|
||||
with pytest.raises(ValidationError):
|
||||
await validation_error_func()
|
||||
@@ -51,7 +51,7 @@ async def test_validation_error(mock_logger):
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@patch("pretor.core.database.database_exception.logger")
|
||||
@patch("kilostar.core.database.database_exception.logger")
|
||||
async def test_integrity_error(mock_logger):
|
||||
with pytest.raises(IntegrityError):
|
||||
await integrity_error_func()
|
||||
@@ -60,7 +60,7 @@ async def test_integrity_error(mock_logger):
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@patch("pretor.core.database.database_exception.logger")
|
||||
@patch("kilostar.core.database.database_exception.logger")
|
||||
async def test_operational_error(mock_logger):
|
||||
with pytest.raises(OperationalError):
|
||||
await operational_error_func()
|
||||
@@ -69,7 +69,7 @@ async def test_operational_error(mock_logger):
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@patch("pretor.core.database.database_exception.logger")
|
||||
@patch("kilostar.core.database.database_exception.logger")
|
||||
async def test_user_not_exist_error(mock_logger):
|
||||
result = await user_not_exist_error_func()
|
||||
assert result is None
|
||||
@@ -78,7 +78,7 @@ async def test_user_not_exist_error(mock_logger):
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@patch("pretor.core.database.database_exception.logger")
|
||||
@patch("kilostar.core.database.database_exception.logger")
|
||||
async def test_generic_exception(mock_logger):
|
||||
with pytest.raises(Exception, match="mock generic exception"):
|
||||
await exception_func()
|
||||
|
||||
Reference in New Issue
Block a user