예제 #1
0
    def test_generate_flake8_command(self) -> None:
        flake8_exe = Path("/bin/flake8")
        with TemporaryDirectory() as td:
            module_dir = Path(td)
            cf = module_dir / ".flake8"
            touch_files(cf)

            conf = {"run_flake8": True}

            self.assertEqual(
                ptr._generate_flake8_cmd(module_dir, flake8_exe, conf),
                (str(flake8_exe), "--config", str(cf)),
            )
예제 #2
0
    def test_generate_flake8_command(self) -> None:
        flake8_exe = Path("/bin/flake8")
        with TemporaryDirectory() as td:
            module_dir = Path(td)
            subdir = module_dir / "awlib"
            cf = module_dir / ".flake8"
            py2 = subdir / "awesome2.py"
            py1 = module_dir / "awesome.py"
            touch_files(cf, py1, py2)

            conf = {"run_flake8": True}

            self.assertEqual(
                ptr._generate_flake8_cmd(module_dir, flake8_exe, conf),
                (str(flake8_exe), "--config", str(cf), str(py1), str(py2)),
            )