Skip to content

Commit

Permalink
Match ls -N tests for Windows/Linux idiosyncrasies
Browse files Browse the repository at this point in the history
  • Loading branch information
MinchinWeb committed May 25, 2016
1 parent f91e053 commit 9d2ae1c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/test_list_command.py
Expand Up @@ -17,6 +17,7 @@
import codecs
import re
import os
import sys
import unittest
from collections import namedtuple

Expand Down Expand Up @@ -346,7 +347,10 @@ def test_list44(self, mock_terminal_size):
Test 'N' parameter with output longer than available terminal lines.
"""
self.todolist = load_file_to_todolist("test/data/ListCommand_50_items.txt")
mock_terminal_size.return_value = self.terminal_size(80, 23)
if "win32" in sys.platform:
mock_terminal_size.return_value = self.terminal_size(80, 23)
else:
mock_terminal_size.return_value = self.terminal_size(80, 22)

command = ListCommand(["-N"], self.todolist, self.out, self.error)
command.execute()
Expand All @@ -360,7 +364,10 @@ def test_list45(self, mock_terminal_size):
"""Test basic 'N' parameter with nine line terminal."""
# have 9 lines on the terminal will print 7 items and leave 2 lines
# for the next prompt
mock_terminal_size.return_value = self.terminal_size(100, 9)
if "win32" in sys.platform:
mock_terminal_size.return_value = self.terminal_size(100, 9)
else:
mock_terminal_size.return_value = self.terminal_size(100, 8)
self.todolist = load_file_to_todolist("test/data/ListCommand_50_items.txt")

command = ListCommand(["-N"], self.todolist, self.out, self.error)
Expand Down Expand Up @@ -391,7 +398,10 @@ def test_list47(self, mock_terminal_size):
Test 'N' parameter with multiline prompt.
"""
self.todolist = load_file_to_todolist("test/data/ListCommand_50_items.txt")
mock_terminal_size.return_value = self.terminal_size(80, 23)
if "win32" in sys.platform:
mock_terminal_size.return_value = self.terminal_size(80, 23)
else:
mock_terminal_size.return_value = self.terminal_size(80, 22)

command = ListCommand(["-N"], self.todolist, self.out, self.error)
command.execute()
Expand Down

0 comments on commit 9d2ae1c

Please sign in to comment.