Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
topydo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
topydo
Commits
9d2ae1c1
Commit
9d2ae1c1
authored
Apr 12, 2016
by
MinchinWeb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Match `ls -N` tests for Windows/Linux idiosyncrasies
parent
f91e0534
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
test/test_list_command.py
test/test_list_command.py
+13
-3
No files found.
test/test_list_command.py
View file @
9d2ae1c1
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
import
codecs
import
codecs
import
re
import
re
import
os
import
os
import
sys
import
unittest
import
unittest
from
collections
import
namedtuple
from
collections
import
namedtuple
...
@@ -346,7 +347,10 @@ class ListCommandTest(CommandTest):
...
@@ -346,7 +347,10 @@ class ListCommandTest(CommandTest):
Test 'N' parameter with output longer than available terminal lines.
Test 'N' parameter with output longer than available terminal lines.
"""
"""
self
.
todolist
=
load_file_to_todolist
(
"test/data/ListCommand_50_items.txt"
)
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
=
ListCommand
([
"-N"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
command
.
execute
()
...
@@ -360,7 +364,10 @@ class ListCommandTest(CommandTest):
...
@@ -360,7 +364,10 @@ class ListCommandTest(CommandTest):
"""Test basic 'N' parameter with nine line terminal."""
"""Test basic 'N' parameter with nine line terminal."""
# have 9 lines on the terminal will print 7 items and leave 2 lines
# have 9 lines on the terminal will print 7 items and leave 2 lines
# for the next prompt
# 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"
)
self
.
todolist
=
load_file_to_todolist
(
"test/data/ListCommand_50_items.txt"
)
command
=
ListCommand
([
"-N"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
=
ListCommand
([
"-N"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
...
@@ -391,7 +398,10 @@ class ListCommandTest(CommandTest):
...
@@ -391,7 +398,10 @@ class ListCommandTest(CommandTest):
Test 'N' parameter with multiline prompt.
Test 'N' parameter with multiline prompt.
"""
"""
self
.
todolist
=
load_file_to_todolist
(
"test/data/ListCommand_50_items.txt"
)
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
=
ListCommand
([
"-N"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
command
.
execute
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment