fix: reject dot project ids

This commit is contained in:
nac
2026-07-13 02:24:58 +00:00
parent 87a26196dd
commit b51be25e2e
4 changed files with 40 additions and 5 deletions
+10
View File
@@ -145,6 +145,16 @@ class ProjectServiceTests(unittest.TestCase):
self.assertEqual(self.nb.update_calls, [])
self.assertEqual(self.http.add_calls, [])
def test_update_rejects_dot_path_project_id_before_any_client_call(self) -> None:
for project_id in (".", ".."):
with self.subTest(project_id=project_id):
self.setUp()
result = self.service.update_project(project_id, name="x", add_attachment_ids=[8])
self.assertEqual(result["error"]["code"], "invalid_project_input")
self.assertEqual(self.nb.update_calls, [])
self.assertEqual(self.http.add_calls, [])
def test_create_rejects_nested_attachment_id_before_any_client_call(self) -> None:
result = self.service.create_project(name="x", attachment_ids=[{"id": 8}])