diff --git a/sia/response_parser.py b/sia/response_parser.py
index 52e954d..040c433 100644
--- a/sia/response_parser.py
+++ b/sia/response_parser.py
@@ -13,7 +13,7 @@ from .parse_error_entry import ParseErrorEntry
from .read_entry import ReadEntry
from .reasoning_entry import ReasoningEntry
from .repeat_entry import RepeatEntry
-from .single_shot_entry import SingleShotEntry
+from .single_entry import SingleEntry
from .write_entry import WriteEntry
class ResponseParser:
@@ -125,11 +125,11 @@ class ResponseParser:
return ParseErrorEntry(xml, "Repeat entry missing script content", entry_id, timestamp)
return RepeatEntry(content, entry_id, timestamp)
- elif root.tag == 'single_shot':
+ elif root.tag == 'single':
# Create single shot script entry
if not content:
return ParseErrorEntry(xml, "Single shot entry missing script content", entry_id, timestamp)
- return SingleShotEntry(content, entry_id, timestamp)
+ return SingleEntry(content, entry_id, timestamp)
elif root.tag == 'reasoning':
# Create reasoning entry
diff --git a/sia/single_shot_entry.py b/sia/single_entry.py
similarity index 97%
rename from sia/single_shot_entry.py
rename to sia/single_entry.py
index 92cf206..3492832 100644
--- a/sia/single_shot_entry.py
+++ b/sia/single_entry.py
@@ -6,7 +6,7 @@ from typing import Optional
from .entry import Entry
from .util import escape_text_for_xml
-class SingleShotEntry(Entry):
+class SingleEntry(Entry):
"""
Entry type for one-time script executions.
@@ -98,7 +98,7 @@ class SingleShotEntry(Entry):
ET.Element: XML element containing the entry's data
"""
# Create root element
- element = ET.Element("single_shot", {
+ element = ET.Element("single", {
"id": self.id,
})
diff --git a/test/response_parser_test.py b/test/response_parser_test.py
index 9c13d3d..d5125d7 100644
--- a/test/response_parser_test.py
+++ b/test/response_parser_test.py
@@ -11,7 +11,7 @@ from sia.parse_error_entry import ParseErrorEntry
from sia.read_entry import ReadEntry
from sia.reasoning_entry import ReasoningEntry
from sia.repeat_entry import RepeatEntry
-from sia.single_shot_entry import SingleShotEntry
+from sia.single_entry import SingleEntry
from sia.write_entry import WriteEntry
from sia.web_io_buffer import WebIOBuffer
from sia.response_parser import ResponseParser
@@ -80,17 +80,17 @@ class ResponseParserTest(unittest.TestCase):
self.assertEqual(result.content, xml)
self.assertIn("missing script content", result.error)
- def test_single_shot_entry(self):
+ def test_single_entry(self):
"""Test parsing single shot entry"""
- xml = 'echo "one time"'
+ xml = 'echo "one time"'
result = self.parser.parse(xml)
- self.assertIsInstance(result, SingleShotEntry)
+ self.assertIsInstance(result, SingleEntry)
self.assertEqual(result.script, 'echo "one time"')
- def test_single_shot_entry_empty_script(self):
+ def test_single_entry_empty_script(self):
"""Test parsing single shot entry with empty script returns error entry"""
- xml = ''
+ xml = ''
result = self.parser.parse(xml)
self.assertIsInstance(result, ParseErrorEntry)
@@ -183,10 +183,10 @@ class ResponseParserTest(unittest.TestCase):
def test_script_with_special_characters(self):
"""Test parsing script with special characters"""
script = 'echo "Special chars: \n\t\r\'\"\\"'
- xml = f'{script}'
+ xml = f'{script}'
result = self.parser.parse(xml)
- self.assertIsInstance(result, SingleShotEntry)
+ self.assertIsInstance(result, SingleEntry)
self.assertEqual(result.script, script)
def test_cdata_content(self):
@@ -206,7 +206,7 @@ class ResponseParserTest(unittest.TestCase):
def test_error_in_content_extraction(self):
"""Test handling errors during content extraction"""
- xml = '' # Malformed CDATA
+ xml = '' # Malformed CDATA
result = self.parser.parse(xml)
self.assertIsInstance(result, ParseErrorEntry)
diff --git a/test/single_shot_entry_test.py b/test/single_entry_test.py
similarity index 85%
rename from test/single_shot_entry_test.py
rename to test/single_entry_test.py
index ac7a08a..1009928 100644
--- a/test/single_shot_entry_test.py
+++ b/test/single_entry_test.py
@@ -2,9 +2,9 @@ import unittest
from datetime import datetime
import os
-from sia.single_shot_entry import SingleShotEntry
+from sia.single_entry import SingleEntry
-class SingleShotEntryTest(unittest.TestCase):
+class SingleEntryTest(unittest.TestCase):
def setUp(self):
"""Set up test cases with fixed id and timestamp"""
self.test_id = "test-id-1234"
@@ -26,7 +26,7 @@ class SingleShotEntryTest(unittest.TestCase):
def test_initialization(self):
"""Test entry initialization"""
script = "echo test"
- entry = SingleShotEntry(script, self.test_id, self.test_timestamp)
+ entry = SingleEntry(script, self.test_id, self.test_timestamp)
self.assertEqual(entry.script, script)
self.assertEqual(entry.stdout, "")
@@ -40,7 +40,7 @@ class SingleShotEntryTest(unittest.TestCase):
"""Test successful script execution"""
script = "echo 'test'"
- entry = SingleShotEntry(script, self.test_id, self.test_timestamp)
+ entry = SingleEntry(script, self.test_id, self.test_timestamp)
entry.update()
# Verify entry state
@@ -51,7 +51,7 @@ class SingleShotEntryTest(unittest.TestCase):
def test_failed_execution(self):
"""Test failed script execution with invalid command"""
- entry = SingleShotEntry("nonexistentcommand", self.test_id, self.test_timestamp)
+ entry = SingleEntry("nonexistentcommand", self.test_id, self.test_timestamp)
entry.update()
# Verify entry state
@@ -64,7 +64,7 @@ class SingleShotEntryTest(unittest.TestCase):
"""Test script that creates a file"""
script = f"echo 'test' > {self.test_filename}"
- entry = SingleShotEntry(script, self.test_id, self.test_timestamp)
+ entry = SingleEntry(script, self.test_id, self.test_timestamp)
entry.update()
# Verify file was created and contains expected content
@@ -77,7 +77,7 @@ class SingleShotEntryTest(unittest.TestCase):
"""Test that script only executes once"""
script = f"echo 'test' >> {self.test_filename}"
- entry = SingleShotEntry(script, self.test_id, self.test_timestamp)
+ entry = SingleEntry(script, self.test_id, self.test_timestamp)
# Run update multiple times
entry.update()
@@ -92,11 +92,11 @@ class SingleShotEntryTest(unittest.TestCase):
def test_generate_context_before_execution(self):
"""Test XML context generation before execution"""
- entry = SingleShotEntry("echo test", self.test_id, self.test_timestamp)
+ entry = SingleEntry("echo test", self.test_id, self.test_timestamp)
element = entry.generate_context()
# Verify XML structure
- self.assertEqual(element.tag, "single_shot")
+ self.assertEqual(element.tag, "single")
self.assertEqual(element.get("id"), self.test_id)
self.assertEqual(element.text, "")
@@ -109,12 +109,12 @@ class SingleShotEntryTest(unittest.TestCase):
"""Test XML context generation after execution"""
script = "echo 'test'"
- entry = SingleShotEntry(script, self.test_id, self.test_timestamp)
+ entry = SingleEntry(script, self.test_id, self.test_timestamp)
entry.update()
element = entry.generate_context()
# Verify XML structure
- self.assertEqual(element.tag, "single_shot")
+ self.assertEqual(element.tag, "single")
self.assertEqual(element.get("id"), self.test_id)
self.assertEqual(element.text, f"")
@@ -130,7 +130,7 @@ class SingleShotEntryTest(unittest.TestCase):
"""Test executing multiple commands in one script"""
script = f"echo 'first' > {self.test_filename} && echo 'second' >> {self.test_filename}"
- entry = SingleShotEntry(script, self.test_id, self.test_timestamp)
+ entry = SingleEntry(script, self.test_id, self.test_timestamp)
entry.update()
# Verify file contains both lines