Properly renamed single_shot_entry to single_entry

This commit is contained in:
2024-11-11 13:26:44 +01:00
parent 1a52205804
commit 0e1a0407d0
4 changed files with 26 additions and 26 deletions

View File

@@ -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 = '<single_shot>echo "one time"</single_shot>'
xml = '<single>echo "one time"</single>'
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 = '<single_shot/>'
xml = '<single/>'
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'<single_shot>{script}</single_shot>'
xml = f'<single>{script}</single>'
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 = '<single_shot><![CDATA[test]]>' # Malformed CDATA
xml = '<single><![CDATA[test]]>' # Malformed CDATA
result = self.parser.parse(xml)
self.assertIsInstance(result, ParseErrorEntry)