diff options
Diffstat (limited to 'src/vgstash/test_vgstash_cli.py')
-rw-r--r-- | src/vgstash/test_vgstash_cli.py | 58 |
1 files changed, 40 insertions, 18 deletions
diff --git a/src/vgstash/test_vgstash_cli.py b/src/vgstash/test_vgstash_cli.py index cbbd151..5ba7d30 100644 --- a/src/vgstash/test_vgstash_cli.py +++ b/src/vgstash/test_vgstash_cli.py @@ -98,13 +98,13 @@ def test_list_pretty(): print(result.output) assert result.exit_code == 0 assert result.output == '\n'.join(( - 'Title | System | Own | Progress ', + 'Title | System | Own | Progress', '--------------------------------------------------------------------------------', - 'Sonic the Hedgehog 2 | Genesis | | B', - 'Vectorman | Genesis | | B', - 'Vectorman 2 | Genesis | P | P ', - 'Super Mario Bros. | NES | P | P ', - 'The Legend of Zelda | NES | D | P \n', + 'Sonic the Hedgehog 2 | Genesis | | B', + 'Vectorman | Genesis | | B', + 'Vectorman 2 | Genesis | P | P', + 'Super Mario Bros. | NES | P | P', + 'The Legend of Zelda | NES | D | P\n', )) @@ -116,13 +116,13 @@ def test_list_pretty_smaller(): print(result.output) assert result.exit_code == 0 assert result.output == '\n'.join(( - 'Title | System | Own | Progress ', + 'Title | System | Own | Progress', '------------------------------------------------------------', - 'Sonic the Hedgehog 2 | Genesis | | B', - 'Vectorman | Genesis | | B', - 'Vectorman 2 | Genesis | P | P ', - 'Super Mario Bros. | NES | P | P ', - 'The Legend of Zelda | NES | D | P \n' + 'Sonic the Hedgehog 2 | Genesis | | B', + 'Vectorman | Genesis | | B', + 'Vectorman 2 | Genesis | P | P', + 'Super Mario Bros. | NES | P | P', + 'The Legend of Zelda | NES | D | P\n' )) @@ -134,13 +134,13 @@ def test_list_pretty_tiny(): print(result.output) assert result.exit_code == 0 assert result.output == '\n'.join(( - 'Title | System | Own | Progress ', + 'Title | System | Own | Progress', '--------------------------------------------------', - 'Sonic the Hedgehog 2 | Genesis | | B', - 'Vectorman | Genesis | | B', - 'Vectorman 2 | Genesis | P | P ', - 'Super Mario Bros. | NES | P | P ', - 'The Legend of Zelda | NES | D | P \n' + 'Sonic the Hedgehog 2 | Genesis | | B', + 'Vectorman | Genesis | | B', + 'Vectorman 2 | Genesis | P | P', + 'Super Mario Bros. | NES | P | P', + 'The Legend of Zelda | NES | D | P\n' )) @@ -151,3 +151,25 @@ def test_delete(): print(result.output) assert result.exit_code == 0 assert result.output == "Removed Vectorman 2 for Genesis from your collection.\n" + + +def test_update(): + runner = CliRunner() + result = runner.invoke(vgstash_cli.cli, ['update', 'Super Mario Bros.', 'NES', 'progress', 'c']) + if verbose: + print(result.output) + assert result.exit_code == 0 + assert result.output == 'Updated Super Mario Bros. for NES. Its progress is now complete.\n' + + list_result = runner.invoke(vgstash_cli.cli, ['list', '-w', '40']) + if verbose: + print(list_result.output) + assert list_result.exit_code == 0 + assert list_result.output == "\n".join(( + 'Title | System | Own | Progress', + '----------------------------------------', + 'Sonic the H | Genesis | | B', + 'Vectorman | Genesis | | B', + 'Super Mario | NES | P | C', + 'The Legend | NES | D | P\n' + )) |