mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-20 13:00:32 +08:00
Add ArtifactNotFound exception
This commit is contained in:
@@ -3,6 +3,7 @@ import tempfile
|
||||
from unittest import TestCase
|
||||
|
||||
from optuna_dashboard.artifact.file_system import FileSystemBackend
|
||||
from optuna_dashboard.artifact.exceptions import ArtifactNotFound
|
||||
|
||||
|
||||
class FileSystemBackendTestCase(TestCase):
|
||||
@@ -20,3 +21,10 @@ class FileSystemBackendTestCase(TestCase):
|
||||
with backend.open(artifact_id) as f:
|
||||
actual = f.read()
|
||||
self.assertEqual(actual, dummy_content)
|
||||
|
||||
def test_file_not_found(self) -> None:
|
||||
backend = FileSystemBackend(self.dir.name)
|
||||
with self.assertRaises(ArtifactNotFound):
|
||||
backend.open("not-found-id")
|
||||
with self.assertRaises(ArtifactNotFound):
|
||||
backend.remove("not-found-id")
|
||||
|
||||
Reference in New Issue
Block a user