예제 #1
0
파일: main_test.py 프로젝트: a1s/pytype
 def testRunPytypeGenerateBuiltins(self):
     """Basic smoke test for --generate-builtins."""
     filename = self._TmpPath("builtins")
     argv = ["--generate-builtins", filename]
     options = config.Options(argv)
     main_module._run_pytype(options)
     self.assertTrue(os.path.isfile(filename))
예제 #2
0
파일: main_test.py 프로젝트: a1s/pytype
 def testRunPytype(self):
     """Basic smoke test for _run_pytype."""
     infile = self._TmpPath("input")
     outfile = self._TmpPath("output")
     with open(infile, "w") as f:
         f.write("def f(x): pass")
     argv = ["", "-o", outfile, infile]
     options = config.Options(argv)
     main_module._run_pytype(options)
     self.assertTrue(os.path.isfile(outfile))
예제 #3
0
파일: main_test.py 프로젝트: lavenzg/pytype
 def testRunPytype(self):
     """Basic unit test (smoke test) for _run_pytype."""
     # TODO(kramm): This is a unit test, whereas all other tests in this file
     # are integration tests. Move this somewhere else?
     infile = self._TmpPath("input")
     outfile = self._TmpPath("output")
     with open(infile, "w") as f:
         f.write("def f(x): pass")
     options = config.Options.create(infile, output=outfile)
     main_module._run_pytype(options)
     self.assertTrue(os.path.isfile(outfile))