changed relative imports to absolute; renamed TelegramBuffer.put to TelegramBuffer.append;
This commit is contained in:
@@ -10,7 +10,7 @@ class TelegramBufferTest(unittest.TestCase):
|
||||
self.telegram_buffer = TelegramBuffer()
|
||||
|
||||
def test_v22_telegram(self):
|
||||
self.telegram_buffer.put(TELEGRAM_V2_2)
|
||||
self.telegram_buffer.append(TELEGRAM_V2_2)
|
||||
|
||||
telegram = next(self.telegram_buffer.get_all())
|
||||
|
||||
@@ -18,7 +18,7 @@ class TelegramBufferTest(unittest.TestCase):
|
||||
self.assertEqual(self.telegram_buffer._buffer, '')
|
||||
|
||||
def test_v42_telegram(self):
|
||||
self.telegram_buffer.put(TELEGRAM_V4_2)
|
||||
self.telegram_buffer.append(TELEGRAM_V4_2)
|
||||
|
||||
telegram = next(self.telegram_buffer.get_all())
|
||||
|
||||
@@ -26,7 +26,7 @@ class TelegramBufferTest(unittest.TestCase):
|
||||
self.assertEqual(self.telegram_buffer._buffer, '')
|
||||
|
||||
def test_multiple_mixed_telegrams(self):
|
||||
self.telegram_buffer.put(
|
||||
self.telegram_buffer.append(
|
||||
''.join((TELEGRAM_V2_2, TELEGRAM_V4_2, TELEGRAM_V2_2))
|
||||
)
|
||||
|
||||
@@ -47,7 +47,7 @@ class TelegramBufferTest(unittest.TestCase):
|
||||
# There are unclosed telegrams at the start of the buffer.
|
||||
incomplete_telegram = TELEGRAM_V4_2[:-1]
|
||||
|
||||
self.telegram_buffer.put(incomplete_telegram + TELEGRAM_V4_2)
|
||||
self.telegram_buffer.append(incomplete_telegram + TELEGRAM_V4_2)
|
||||
|
||||
telegram = next(self.telegram_buffer.get_all())
|
||||
|
||||
@@ -59,7 +59,7 @@ class TelegramBufferTest(unittest.TestCase):
|
||||
# the buffer was being filled while the telegram was outputted halfway.
|
||||
incomplete_telegram = TELEGRAM_V4_2[1:]
|
||||
|
||||
self.telegram_buffer.put(incomplete_telegram + TELEGRAM_V4_2)
|
||||
self.telegram_buffer.append(incomplete_telegram + TELEGRAM_V4_2)
|
||||
|
||||
telegram = next(self.telegram_buffer.get_all())
|
||||
|
||||
@@ -69,7 +69,7 @@ class TelegramBufferTest(unittest.TestCase):
|
||||
def test_v42_telegram_trailed_by_unclosed_telegram(self):
|
||||
incomplete_telegram = TELEGRAM_V4_2[:-1]
|
||||
|
||||
self.telegram_buffer.put(TELEGRAM_V4_2 + incomplete_telegram)
|
||||
self.telegram_buffer.append(TELEGRAM_V4_2 + incomplete_telegram)
|
||||
|
||||
telegram = next(self.telegram_buffer.get_all())
|
||||
|
||||
@@ -79,7 +79,7 @@ class TelegramBufferTest(unittest.TestCase):
|
||||
def test_v42_telegram_trailed_by_unopened_telegram(self):
|
||||
incomplete_telegram = TELEGRAM_V4_2[1:]
|
||||
|
||||
self.telegram_buffer.put(TELEGRAM_V4_2 + incomplete_telegram)
|
||||
self.telegram_buffer.append(TELEGRAM_V4_2 + incomplete_telegram)
|
||||
|
||||
telegram = next(self.telegram_buffer.get_all())
|
||||
|
||||
@@ -88,7 +88,7 @@ class TelegramBufferTest(unittest.TestCase):
|
||||
|
||||
def test_v42_telegram_adding_line_by_line(self):
|
||||
for line in TELEGRAM_V4_2.splitlines(keepends=True):
|
||||
self.telegram_buffer.put(line)
|
||||
self.telegram_buffer.append(line)
|
||||
|
||||
telegram = next(self.telegram_buffer.get_all())
|
||||
|
||||
@@ -97,7 +97,7 @@ class TelegramBufferTest(unittest.TestCase):
|
||||
|
||||
def test_v42_telegram_adding_char_by_char(self):
|
||||
for char in TELEGRAM_V4_2:
|
||||
self.telegram_buffer.put(char)
|
||||
self.telegram_buffer.append(char)
|
||||
|
||||
telegram = next(self.telegram_buffer.get_all())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user