Permalink
Browse files

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.
  • Loading branch information...
The-Compiler committed Jun 9, 2016
1 parent c5c0222 commit d6926f06227616c0f659ff1f39ec84f0e9b67465
Showing with 2 additions and 2 deletions.
  1. +2 −2 tests/unit/misc/test_lineparser.py
@@ -147,6 +147,6 @@ def test_get_recent_much(self, lineparser):
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

0 comments on commit d6926f0

Please sign in to comment.