Added timeout and limit to script entries

This commit is contained in:
Niels Geens
2024-11-13 17:48:39 +01:00
parent 65478e0b17
commit 834ce12e8f
21 changed files with 262 additions and 141 deletions

View File

@@ -8,8 +8,6 @@ from sia.delete_command import DeleteCommand
from sia.reasoning_entry import ReasoningEntry
from sia.background_entry import BackgroundEntry
class DeleteCommandTest(unittest.TestCase):
def setUp(self):
"""Set up test cases with a fresh working memory"""
@@ -31,7 +29,7 @@ class DeleteCommandTest(unittest.TestCase):
def test_delete_running_background_entry(self):
"""Test deleting a background entry that is still running"""
# Create and start background process
entry = BackgroundEntry("sleep 10", "test-id", self.test_timestamp)
entry = BackgroundEntry(self.test_id, self.test_timestamp, "sleep 10")
self.memory.add_entry(entry)
# Wait for process to start
@@ -58,7 +56,7 @@ class DeleteCommandTest(unittest.TestCase):
def test_delete_existing_entry(self):
"""Test deleting an existing entry"""
# Add test entry
entry = ReasoningEntry("test content", self.test_id, self.test_timestamp)
entry = ReasoningEntry(self.test_id, self.test_timestamp, "test content")
self.memory.add_entry(entry)
# Execute delete command