Added timeout and limit to script entries
This commit is contained in:
@@ -13,7 +13,7 @@ class ReadEntryTest(unittest.TestCase):
|
||||
|
||||
def test_initialization(self):
|
||||
"""Test entry initialization"""
|
||||
entry = ReadEntry(self.io_buffer, self.test_id, self.test_timestamp)
|
||||
entry = ReadEntry(self.test_id, self.test_timestamp, self.io_buffer)
|
||||
|
||||
self.assertEqual(entry.content, "")
|
||||
self.assertEqual(entry.id, self.test_id)
|
||||
@@ -24,7 +24,7 @@ class ReadEntryTest(unittest.TestCase):
|
||||
test_input = "test message"
|
||||
self.io_buffer.append_stdin(test_input)
|
||||
|
||||
entry = ReadEntry(self.io_buffer, self.test_id, self.test_timestamp)
|
||||
entry = ReadEntry(self.test_id, self.test_timestamp, self.io_buffer)
|
||||
entry.update()
|
||||
|
||||
self.assertEqual(entry.content, test_input)
|
||||
@@ -35,7 +35,7 @@ class ReadEntryTest(unittest.TestCase):
|
||||
test_input = "initial input"
|
||||
self.io_buffer.append_stdin(test_input)
|
||||
|
||||
entry = ReadEntry(self.io_buffer, self.test_id, self.test_timestamp)
|
||||
entry = ReadEntry(self.test_id, self.test_timestamp, self.io_buffer)
|
||||
entry.update()
|
||||
initial_content = entry.content
|
||||
|
||||
@@ -47,7 +47,7 @@ class ReadEntryTest(unittest.TestCase):
|
||||
|
||||
def test_empty_input(self):
|
||||
"""Test reading when no input is available"""
|
||||
entry = ReadEntry(self.io_buffer, self.test_id, self.test_timestamp)
|
||||
entry = ReadEntry(self.test_id, self.test_timestamp, self.io_buffer)
|
||||
entry.update()
|
||||
|
||||
self.assertEqual(entry.content, "")
|
||||
@@ -57,7 +57,7 @@ class ReadEntryTest(unittest.TestCase):
|
||||
test_input = "Special chars: \n\t\r\'\"\\"
|
||||
self.io_buffer.append_stdin(test_input)
|
||||
|
||||
entry = ReadEntry(self.io_buffer, self.test_id, self.test_timestamp)
|
||||
entry = ReadEntry(self.test_id, self.test_timestamp, self.io_buffer)
|
||||
entry.update()
|
||||
|
||||
self.assertEqual(entry.content, test_input)
|
||||
@@ -67,14 +67,14 @@ class ReadEntryTest(unittest.TestCase):
|
||||
test_input = "x" * 10000
|
||||
self.io_buffer.append_stdin(test_input)
|
||||
|
||||
entry = ReadEntry(self.io_buffer, self.test_id, self.test_timestamp)
|
||||
entry = ReadEntry(self.test_id, self.test_timestamp, self.io_buffer)
|
||||
entry.update()
|
||||
|
||||
self.assertEqual(entry.content, test_input)
|
||||
|
||||
def test_generate_context_before_read(self):
|
||||
"""Test XML context generation before reading"""
|
||||
entry = ReadEntry(self.io_buffer, self.test_id, self.test_timestamp)
|
||||
entry = ReadEntry(self.test_id, self.test_timestamp, self.io_buffer)
|
||||
element = entry.generate_context()
|
||||
|
||||
# Verify XML structure
|
||||
@@ -87,7 +87,7 @@ class ReadEntryTest(unittest.TestCase):
|
||||
test_input = "test message"
|
||||
self.io_buffer.append_stdin(test_input)
|
||||
|
||||
entry = ReadEntry(self.io_buffer, self.test_id, self.test_timestamp)
|
||||
entry = ReadEntry(self.test_id, self.test_timestamp, self.io_buffer)
|
||||
entry.update()
|
||||
element = entry.generate_context()
|
||||
|
||||
@@ -101,7 +101,7 @@ class ReadEntryTest(unittest.TestCase):
|
||||
test_input = "Hello 世界 😊"
|
||||
self.io_buffer.append_stdin(test_input)
|
||||
|
||||
entry = ReadEntry(self.io_buffer, self.test_id, self.test_timestamp)
|
||||
entry = ReadEntry(self.test_id, self.test_timestamp, self.io_buffer)
|
||||
entry.update()
|
||||
|
||||
self.assertEqual(entry.content, test_input)
|
||||
@@ -113,7 +113,7 @@ class ReadEntryTest(unittest.TestCase):
|
||||
Line 3"""
|
||||
self.io_buffer.append_stdin(test_input)
|
||||
|
||||
entry = ReadEntry(self.io_buffer, self.test_id, self.test_timestamp)
|
||||
entry = ReadEntry(self.test_id, self.test_timestamp, self.io_buffer)
|
||||
entry.update()
|
||||
|
||||
self.assertEqual(entry.content, test_input)
|
||||
|
||||
Reference in New Issue
Block a user