aboutsummaryrefslogtreecommitdiff
path: root/src/vgstash/test_vgstash_cli.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/vgstash/test_vgstash_cli.py50
1 files changed, 49 insertions, 1 deletions
diff --git a/src/vgstash/test_vgstash_cli.py b/src/vgstash/test_vgstash_cli.py
index 3ad661d..d0def8b 100644
--- a/src/vgstash/test_vgstash_cli.py
+++ b/src/vgstash/test_vgstash_cli.py
@@ -6,7 +6,7 @@ import vgstash_cli
from click.testing import CliRunner
-verbose = False
+verbose = True
def test_init():
runner = CliRunner()
@@ -81,3 +81,51 @@ def test_list_filter():
'Super Mario Bros.|NES|1|2|',
'The Legend of Zelda|NES|2|2|\n',
))
+
+def test_list_pretty():
+ runner = CliRunner()
+ result = runner.invoke(vgstash_cli.cli, ['list', '-w', '80'])
+ if verbose:
+ print(result.output)
+ assert result.exit_code == 0
+ assert result.output == '\n'.join((
+ ' ID | Title | System | Own | Status ',
+ '--------------------------------------------------------------------------------',
+ ' 3 | Sonic the Hedgehog 2 | Genesis | | C',
+ ' 4 | Vectorman | Genesis | | C',
+ ' 5 | Vectorman 2 | Genesis | P | B ',
+ ' 1 | Super Mario Bros. | NES | P | B ',
+ ' 2 | The Legend of Zelda | NES | D | B \n'
+ ))
+
+def test_list_pretty_smaller():
+ runner = CliRunner()
+ result = runner.invoke(vgstash_cli.cli, ['list', '-w', '60'])
+ if verbose:
+ print(result.output)
+ assert result.exit_code == 0
+ assert result.output == '\n'.join((
+ ' ID | Title | System | Own | Status ',
+ '------------------------------------------------------------',
+ ' 3 | Sonic the Hedgehog 2 | Genesis | | C',
+ ' 4 | Vectorman | Genesis | | C',
+ ' 5 | Vectorman 2 | Genesis | P | B ',
+ ' 1 | Super Mario Bros. | NES | P | B ',
+ ' 2 | The Legend of Zelda | NES | D | B \n'
+ ))
+
+def test_list_pretty_tiny():
+ runner = CliRunner()
+ result = runner.invoke(vgstash_cli.cli, ['list', '-w', '50'])
+ if verbose:
+ print(result.output)
+ assert result.exit_code == 0
+ assert result.output == '\n'.join((
+ ' ID | Title | System | Own | Status ',
+ '--------------------------------------------------',
+ ' 3 | Sonic the Hedge | Genesis | | C',
+ ' 4 | Vectorman | Genesis | | C',
+ ' 5 | Vectorman 2 | Genesis | P | B ',
+ ' 1 | Super Mario Bro | NES | P | B ',
+ ' 2 | The Legend of Z | NES | D | B \n'
+ ))