Exemplo n.º 1
0
 def test__short(self):
     tf1 = ShellFormatter(self.record_list, project=MockProject())
     txt = tf1.short()
     tmpdir = tempfile.mkdtemp()
     with open(os.path.join(tmpdir,"test.sh"), "w") as fp:
         fp.write(txt)
     returncode, stdout, stderr = run(["sh", "-n", "test.sh"], cwd=tmpdir)  # check syntax
     self.assertEqual(returncode, 0)
     shutil.rmtree(tmpdir)
Exemplo n.º 2
0
 def test__short(self):
     tf1 = ShellFormatter(self.record_list, project=MockProject())
     txt = tf1.short()
     tmpdir = tempfile.mkdtemp()
     with open(os.path.join(tmpdir,"test.sh"), "w") as fp:
         fp.write(txt)
     returncode, stdout, stderr = run(["sh", "-n", "test.sh"], cwd=tmpdir)  # check syntax
     self.assertEqual(returncode, 0)
     shutil.rmtree(tmpdir)
Exemplo n.º 3
0
 def test__long(self):
     tf1 = LaTeXFormatter(self.record_list, project=MockProject())
     txt = tf1.long()
     with open(os.path.join(self.tmpdir, "test.tex"), "w") as fp:
         fp.write(txt)
     if get_executable("pdflatex").path == "pdflatex":  # pdflatex not found
         raise unittest.SkipTest("pdflatex not found")
     else:
         returncode, stdout, stderr = run(["pdflatex", "-interaction=nonstopmode", "test.tex"], cwd=self.tmpdir)  # check it builds
         output = stdout + stderr
         if returncode != 0:
             if "not found" in output:
                 raise unittest.SkipTest("One of the required LaTeX packages is unavailable")
             else:
                 self.fail(output)
Exemplo n.º 4
0
 def test__long(self):
     tf1 = LaTeXFormatter(self.record_list, project=MockProject())
     txt = tf1.long()
     tmpdir = tempfile.mkdtemp()
     with open(os.path.join(tmpdir, "test.tex"), "w") as fp:
         fp.write(txt)
     if get_executable("pdflatex").path == "pdflatex":  # pdflatex not found
         raise unittest.SkipTest
     else:
         returncode, stdout, stderr = run(["pdflatex", "test.tex"], cwd=tmpdir)  # check it builds
         output = stdout + stderr
         if returncode != 0:
             if "not found" in output:  # one of the required LaTeX packages is unavailable
                 raise unittest.SkipTest
             else:
                 self.fail(output)
     shutil.rmtree(tmpdir)
Exemplo n.º 5
0
 def test__long(self):
     tf1 = LaTeXFormatter(self.record_list, project=MockProject())
     txt = tf1.long()
     tmpdir = tempfile.mkdtemp()
     with open(os.path.join(tmpdir, "test.tex"), "w") as fp:
         fp.write(txt)
     if get_executable("pdflatex").path == "pdflatex":  # pdflatex not found
         raise unittest.SkipTest
     else:
         returncode, stdout, stderr = run(["pdflatex", "test.tex"],
                                          cwd=tmpdir)  # check it builds
         output = stdout + stderr
         if returncode != 0:
             if "not found" in output:  # one of the required LaTeX packages is unavailable
                 raise unittest.SkipTest
             else:
                 self.fail(output)
     shutil.rmtree(tmpdir)
Exemplo n.º 6
0
 def _get_version(self):
     returncode, output, err = run("gams file_that_doesnt_exist.gms lo=3", shell=True)
     return version_in_command_line_output(command_line_output=output + err)