File: test_command_version.py

package info (click to toggle)
python-scrapy 2.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,308 kB
  • sloc: python: 55,321; xml: 199; makefile: 25; sh: 7
file content (25 lines) | stat: -rw-r--r-- 678 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import scrapy
from tests.utils.cmdline import proc


class TestVersionCommand:
    def test_output(self) -> None:
        _, out, _ = proc("version")
        assert out.strip() == f"Scrapy {scrapy.__version__}"

    def test_verbose_output(self) -> None:
        _, out, _ = proc("version", "-v")
        headers = [line.partition(":")[0].strip() for line in out.strip().splitlines()]
        assert headers == [
            "Scrapy",
            "lxml",
            "libxml2",
            "cssselect",
            "parsel",
            "w3lib",
            "Twisted",
            "Python",
            "pyOpenSSL",
            "cryptography",
            "Platform",
        ]