From 43fc2f23b80083f89ae1e982bfdee5d4e0322556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a?= Date: Thu, 13 Aug 2015 19:30:06 -0300 Subject: [PATCH] Increase coverage of version command --- tests/test_command_version.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/test_command_version.py b/tests/test_command_version.py index 420713d87..37e1f2543 100644 --- a/tests/test_command_version.py +++ b/tests/test_command_version.py @@ -14,4 +14,16 @@ class VersionTest(ProcessTest, unittest.TestCase): def test_output(self): encoding = getattr(sys.stdout, 'encoding') or 'utf-8' _, out, _ = yield self.execute([]) - self.assertEqual(out.strip().decode(encoding), "Scrapy %s" % scrapy.__version__) + self.assertEqual( + out.strip().decode(encoding), + "Scrapy %s" % scrapy.__version__, + ) + + @defer.inlineCallbacks + def test_verbose_output(self): + encoding = getattr(sys.stdout, 'encoding') or 'utf-8' + _, out, _ = yield self.execute(['-v']) + headers = [l.partition(":")[0].strip() + for l in out.strip().decode(encoding).splitlines()] + self.assertEqual(headers, ['Scrapy', 'lxml', 'libxml2', 'Twisted', + 'Python', 'pyOpenSSL', 'Platform'])