Commit e5638dff by Sébastien Eustace

Normalize command ouput in tests

parent 5fd64978
...@@ -15,4 +15,4 @@ See https://github.com/sdispater/poetry for more information. ...@@ -15,4 +15,4 @@ See https://github.com/sdispater/poetry for more information.
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
...@@ -29,7 +29,7 @@ Writing lock file ...@@ -29,7 +29,7 @@ Writing lock file
- Installing cachy (0.2.0) - Installing cachy (0.2.0)
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
assert len(installer.installs) == 1 assert len(installer.installs) == 1
...@@ -61,7 +61,7 @@ Writing lock file ...@@ -61,7 +61,7 @@ Writing lock file
- Installing cachy (0.1.0) - Installing cachy (0.1.0)
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
assert len(installer.installs) == 1 assert len(installer.installs) == 1
...@@ -94,7 +94,7 @@ Writing lock file ...@@ -94,7 +94,7 @@ Writing lock file
- Installing cachy (0.2.0) - Installing cachy (0.2.0)
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
assert len(installer.installs) == 2 assert len(installer.installs) == 2
...@@ -127,7 +127,7 @@ Writing lock file ...@@ -127,7 +127,7 @@ Writing lock file
- Installing demo (0.1.2 9cf87a2) - Installing demo (0.1.2 9cf87a2)
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
assert len(installer.installs) == 2 assert len(installer.installs) == 2
...@@ -167,7 +167,7 @@ Writing lock file ...@@ -167,7 +167,7 @@ Writing lock file
- Installing demo (0.1.2 9cf87a2) - Installing demo (0.1.2 9cf87a2)
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
assert len(installer.installs) == 2 assert len(installer.installs) == 2
...@@ -200,7 +200,7 @@ Writing lock file ...@@ -200,7 +200,7 @@ Writing lock file
- Installing demo (0.1.0) - Installing demo (0.1.0)
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
assert len(installer.installs) == 2 assert len(installer.installs) == 2
...@@ -240,7 +240,7 @@ Writing lock file ...@@ -240,7 +240,7 @@ Writing lock file
- Installing demo (0.1.0) - Installing demo (0.1.0)
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
assert len(installer.installs) == 2 assert len(installer.installs) == 2
...@@ -287,7 +287,7 @@ Writing lock file ...@@ -287,7 +287,7 @@ Writing lock file
- Installing cachy (0.2.0) - Installing cachy (0.2.0)
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
assert len(installer.installs) == 2 assert len(installer.installs) == 2
...@@ -330,7 +330,7 @@ Writing lock file ...@@ -330,7 +330,7 @@ Writing lock file
- Installing cachy (0.2.0) - Installing cachy (0.2.0)
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
assert len(installer.installs) == 1 assert len(installer.installs) == 1
...@@ -371,7 +371,7 @@ Writing lock file ...@@ -371,7 +371,7 @@ Writing lock file
- Installing cachy (0.2.0) - Installing cachy (0.2.0)
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
assert len(installer.installs) == 1 assert len(installer.installs) == 1
......
...@@ -11,4 +11,4 @@ def test_about(app): ...@@ -11,4 +11,4 @@ def test_about(app):
All set! All set!
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
...@@ -42,7 +42,7 @@ def test_basic_interactive(app, mocker, poetry): ...@@ -42,7 +42,7 @@ def test_basic_interactive(app, mocker, poetry):
) )
tester.execute([("command", command.name)]) tester.execute([("command", command.name)])
output = tester.get_display() output = tester.get_display(True)
expected = """\ expected = """\
[tool.poetry] [tool.poetry]
name = "my-package" name = "my-package"
...@@ -91,7 +91,7 @@ def test_interactive_with_dependencies(app, repo, mocker, poetry): ...@@ -91,7 +91,7 @@ def test_interactive_with_dependencies(app, repo, mocker, poetry):
) )
tester.execute([("command", command.name)]) tester.execute([("command", command.name)])
output = tester.get_display() output = tester.get_display(True)
expected = """\ expected = """\
[tool.poetry] [tool.poetry]
name = "my-package" name = "my-package"
......
...@@ -55,7 +55,7 @@ cachy 0.1.0 Cachy package ...@@ -55,7 +55,7 @@ cachy 0.1.0 Cachy package
pendulum 2.0.0 Pendulum package pendulum 2.0.0 Pendulum package
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
def test_show_basic_with_not_installed_packages_non_decorated(app, poetry, installed): def test_show_basic_with_not_installed_packages_non_decorated(app, poetry, installed):
...@@ -109,7 +109,7 @@ cachy 0.1.0 Cachy package ...@@ -109,7 +109,7 @@ cachy 0.1.0 Cachy package
pendulum (!) 2.0.0 Pendulum package pendulum (!) 2.0.0 Pendulum package
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
def test_show_basic_with_not_installed_packages_decorated(app, poetry, installed): def test_show_basic_with_not_installed_packages_decorated(app, poetry, installed):
...@@ -163,7 +163,7 @@ def test_show_basic_with_not_installed_packages_decorated(app, poetry, installed ...@@ -163,7 +163,7 @@ def test_show_basic_with_not_installed_packages_decorated(app, poetry, installed
\033[31mpendulum\033[0m \033[36m2.0.0\033[0m Pendulum package \033[31mpendulum\033[0m \033[36m2.0.0\033[0m Pendulum package
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
def test_show_latest_non_decorated(app, poetry, installed, repo): def test_show_latest_non_decorated(app, poetry, installed, repo):
...@@ -228,7 +228,7 @@ cachy 0.1.0 0.2.0 Cachy package ...@@ -228,7 +228,7 @@ cachy 0.1.0 0.2.0 Cachy package
pendulum 2.0.0 2.0.1 Pendulum package pendulum 2.0.0 2.0.1 Pendulum package
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
def test_show_latest_decorated(app, poetry, installed, repo): def test_show_latest_decorated(app, poetry, installed, repo):
...@@ -295,7 +295,7 @@ def test_show_latest_decorated(app, poetry, installed, repo): ...@@ -295,7 +295,7 @@ def test_show_latest_decorated(app, poetry, installed, repo):
\033[32mpendulum\033[0m \033[36m2.0.0\033[0m \033[31m2.0.1\033[0m Pendulum package \033[32mpendulum\033[0m \033[36m2.0.0\033[0m \033[31m2.0.1\033[0m Pendulum package
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
def test_show_outdated(app, poetry, installed, repo): def test_show_outdated(app, poetry, installed, repo):
...@@ -356,7 +356,7 @@ def test_show_outdated(app, poetry, installed, repo): ...@@ -356,7 +356,7 @@ def test_show_outdated(app, poetry, installed, repo):
cachy 0.1.0 0.2.0 Cachy package cachy 0.1.0 0.2.0 Cachy package
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
def test_show_hides_incompatible_package(app, poetry, installed, repo): def test_show_hides_incompatible_package(app, poetry, installed, repo):
...@@ -411,7 +411,7 @@ def test_show_hides_incompatible_package(app, poetry, installed, repo): ...@@ -411,7 +411,7 @@ def test_show_hides_incompatible_package(app, poetry, installed, repo):
pendulum 2.0.0 Pendulum package pendulum 2.0.0 Pendulum package
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
def test_show_all_shows_incompatible_package(app, poetry, installed, repo): def test_show_all_shows_incompatible_package(app, poetry, installed, repo):
...@@ -467,4 +467,4 @@ cachy 0.1.0 Cachy package ...@@ -467,4 +467,4 @@ cachy 0.1.0 Cachy package
pendulum 2.0.0 Pendulum package pendulum 2.0.0 Pendulum package
""" """
assert tester.get_display() == expected assert tester.get_display(True) == expected
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment