From d6926f06227616c0f659ff1f39ec84f0e9b67465 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 9 Jun 2016 10:26:09 +0200 Subject: [PATCH] Fix expected data in AppendLineParser test There were two different issues here: - `\n` rather than `os.linesep` was used, which caused the "generated" file to have less data in it than expected - A final `os.linesep` (or `\n`) was missing, but that was cancelled out by a off-by-one error when slicing, so wasn't an issue until we tried with \r\n endings. --- tests/unit/misc/test_lineparser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/misc/test_lineparser.py b/tests/unit/misc/test_lineparser.py index 9bf3d71b4..c8f5de217 100644 --- a/tests/unit/misc/test_lineparser.py +++ b/tests/unit/misc/test_lineparser.py @@ -147,6 +147,6 @@ class TestAppendLineParser: new_data = ['new data {}'.format(i) for i in range(size)] lineparser.new_data = new_data lineparser.save() - data = '\n'.join(self.BASE_DATA + new_data) - data = [e + '\n' for e in data[-(size - 1):].splitlines()] + data = os.linesep.join(self.BASE_DATA + new_data) + os.linesep + data = [e + '\n' for e in data[-size:].splitlines()] assert lineparser.get_recent(size) == data