test: 8 parallel agents — fix 150+ failures, add 30+ test files. schemas/models 99-100%, core/client_registry ~98%, maintenance 95-98%, git edges 97%, translate 98-100%, dashboard routes 95-96%, dataset_review 100%
This commit is contained in:
@@ -68,7 +68,7 @@ class TestListFiles:
|
||||
mock_loader.get_plugin.return_value = mock_plugin
|
||||
resp = client.get(f"{P}/files?category=BACKUPS&path=/test&recursive=true")
|
||||
assert resp.status_code == 200
|
||||
mock_plugin.list_files.assert_called_once_with("BACKUPS", "/test", True)
|
||||
mock_plugin.list_files.assert_called_once_with("backups", "/test", True)
|
||||
|
||||
def test_plugin_not_loaded(self):
|
||||
client, mock_loader = _make_client()
|
||||
@@ -85,7 +85,7 @@ class TestUploadFile:
|
||||
mock_plugin = MagicMock()
|
||||
mock_plugin.save_file = AsyncMock(return_value={"name": "test.txt"})
|
||||
mock_loader.get_plugin.return_value = mock_plugin
|
||||
resp = client.post(f"{P}/upload", data={"category": "BACKUPS"}, files={"file": ("test.txt", b"hello")})
|
||||
resp = client.post(f"{P}/upload", data={"category": "backups"}, files={"file": ("test.txt", b"hello")})
|
||||
assert resp.status_code == 201
|
||||
|
||||
def test_value_error(self):
|
||||
@@ -93,13 +93,13 @@ class TestUploadFile:
|
||||
mock_plugin = MagicMock()
|
||||
mock_plugin.save_file = AsyncMock(side_effect=ValueError("bad"))
|
||||
mock_loader.get_plugin.return_value = mock_plugin
|
||||
resp = client.post(f"{P}/upload", data={"category": "BACKUPS"}, files={"file": ("test.txt", b"data")})
|
||||
resp = client.post(f"{P}/upload", data={"category": "backups"}, files={"file": ("test.txt", b"data")})
|
||||
assert resp.status_code == 400
|
||||
|
||||
def test_plugin_not_loaded(self):
|
||||
client, mock_loader = _make_client()
|
||||
mock_loader.get_plugin.return_value = None
|
||||
resp = client.post(f"{P}/upload", data={"category": "BACKUPS"}, files={"file": ("test.txt", b"data")})
|
||||
resp = client.post(f"{P}/upload", data={"category": "backups"}, files={"file": ("test.txt", b"data")})
|
||||
assert resp.status_code == 500
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user