Fix add account request metadata handling
This commit is contained in:
@@ -928,7 +928,12 @@ class Engine:
|
||||
|
||||
async def _command(self, name, data):
|
||||
if name == "add":
|
||||
ident = self.store.add(**data)
|
||||
ident = self.store.add(
|
||||
role=data["role"],
|
||||
name=data["name"],
|
||||
uid=data.get("uid"),
|
||||
owner=data.get("owner"),
|
||||
)
|
||||
self.begin_login(ident)
|
||||
return ident
|
||||
if name == "rule":
|
||||
|
||||
@@ -756,7 +756,12 @@ class EngineTest(unittest.IsolatedAsyncioTestCase):
|
||||
async def test_unbound_group_cannot_start_and_add_starts_login_only(self):
|
||||
with patch.object(self.engine, "begin_login") as login:
|
||||
ident = await self.engine.command(
|
||||
"add", {"role": "main", "name": "界面名称"}
|
||||
"add",
|
||||
{
|
||||
"role": "main",
|
||||
"name": "界面名称",
|
||||
"_request_id": "request-1",
|
||||
},
|
||||
)
|
||||
login.assert_called_once_with(ident)
|
||||
with self.assertRaises(ValueError):
|
||||
|
||||
Reference in New Issue
Block a user