File: test_help.py

package info (click to toggle)
mopidy 3.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,608 kB
  • sloc: python: 16,656; sh: 159; makefile: 127
file content (31 lines) | stat: -rw-r--r-- 871 bytes parent folder | download | duplicates (3)
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
26
27
28
29
30
31
import os
import subprocess
import sys
import unittest

import mopidy


class HelpTest(unittest.TestCase):
    def test_help_has_mopidy_options(self):
        mopidy_dir = os.path.dirname(mopidy.__file__)
        args = [sys.executable, mopidy_dir, "--help"]
        process = subprocess.Popen(
            args,
            env={
                "PYTHONPATH": ":".join(
                    [
                        os.path.join(mopidy_dir, ".."),
                        os.environ.get("PYTHONPATH", ""),
                    ]
                )
            },
            stdout=subprocess.PIPE,
        )
        output = process.communicate()[0]
        assert b"--version" in output
        assert b"--help" in output
        assert b"--quiet" in output
        assert b"--verbose" in output
        assert b"--config" in output
        assert b"--option" in output