style: 项目重构
1.项目改名为kilostar(千星) 2.后端部分进行大规模重构 3.node功能进行大规模重新设计
This commit is contained in:
@@ -26,19 +26,19 @@ def mock_import(name, globals=None, locals=None, fromlist=(), level=0):
|
||||
|
||||
builtins.__import__ = mock_import
|
||||
for mod in list(sys.modules.keys()):
|
||||
if "pretor.core.postgres_database.postgres" in mod or "ray" in mod:
|
||||
if "kilostar.core.postgres_database.postgres" in mod or "ray" in mod:
|
||||
del sys.modules[mod]
|
||||
|
||||
from pretor.core.postgres_database.postgres import PostgresDatabase # noqa: E402
|
||||
from kilostar.core.postgres_database.postgres import PostgresDatabase # noqa: E402
|
||||
|
||||
builtins.__import__ = real_import
|
||||
|
||||
|
||||
@patch("pretor.core.postgres_database.postgres.create_async_engine")
|
||||
@patch("pretor.core.postgres_database.postgres.sessionmaker")
|
||||
@patch("pretor.core.postgres_database.postgres.AuthDatabase")
|
||||
@patch("pretor.core.postgres_database.postgres.ProviderDatabase")
|
||||
@patch("pretor.core.postgres_database.postgres.os.environ.get")
|
||||
@patch("kilostar.core.postgres_database.postgres.create_async_engine")
|
||||
@patch("kilostar.core.postgres_database.postgres.sessionmaker")
|
||||
@patch("kilostar.core.postgres_database.postgres.AuthDatabase")
|
||||
@patch("kilostar.core.postgres_database.postgres.ProviderDatabase")
|
||||
@patch("kilostar.core.postgres_database.postgres.os.environ.get")
|
||||
@pytest.mark.asyncio
|
||||
async def test_postgres_database(
|
||||
mock_env_get, mock_provider_db, mock_auth_db, mock_sessionmaker, mock_create_engine
|
||||
@@ -76,7 +76,7 @@ async def test_postgres_database(
|
||||
mock_auth_db.return_value.get_user_authority = AsyncMock(return_value="test_auth")
|
||||
|
||||
with patch(
|
||||
"pretor.core.postgres_database.postgres.SQLModel.metadata.create_all"
|
||||
"kilostar.core.postgres_database.postgres.SQLModel.metadata.create_all"
|
||||
) as mock_create_all:
|
||||
await db.init_db()
|
||||
mock_conn.run_sync.assert_called_once_with(mock_create_all)
|
||||
|
||||
Reference in New Issue
Block a user