Example #1
0
    def test_generate_pyre_cmd(self) -> None:
        with TemporaryDirectory() as td:
            td_path = Path(td)
            pyre_exe = Path("pyre")

            conf = {"run_pyre": True}
            if ptr.WINDOWS:
                self.assertEqual(
                    ptr._generate_pyre_cmd(td_path, pyre_exe, conf), ())
            else:
                self.assertEqual(
                    ptr._generate_pyre_cmd(td_path, pyre_exe, conf),
                    (str(pyre_exe), "--source-directory", str(td_path),
                     "check"),
                )
Example #2
0
File: ptr_tests.py Project: up1/ptr
    def test_generate_pyre_cmd(self) -> None:
        with TemporaryDirectory() as td:
            td_path = Path(td)
            pyre_exe = Path("pyre")

            conf = {"run_pyre": True}
            expected = (str(pyre_exe), "--source-directory", str(td_path),
                        "check")
            if ptr.WINDOWS or ptr.GREATER_THAN_37:
                expected = ()
            self.assertEqual(ptr._generate_pyre_cmd(td_path, pyre_exe, conf),
                             expected)