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.
This commit is contained in:
parent
c5c022226f
commit
d6926f0622
@ -147,6 +147,6 @@ class TestAppendLineParser:
|
|||||||
new_data = ['new data {}'.format(i) for i in range(size)]
|
new_data = ['new data {}'.format(i) for i in range(size)]
|
||||||
lineparser.new_data = new_data
|
lineparser.new_data = new_data
|
||||||
lineparser.save()
|
lineparser.save()
|
||||||
data = '\n'.join(self.BASE_DATA + new_data)
|
data = os.linesep.join(self.BASE_DATA + new_data) + os.linesep
|
||||||
data = [e + '\n' for e in data[-(size - 1):].splitlines()]
|
data = [e + '\n' for e in data[-size:].splitlines()]
|
||||||
assert lineparser.get_recent(size) == data
|
assert lineparser.get_recent(size) == data
|
||||||
|
Loading…
Reference in New Issue
Block a user