Esempio n. 1
0
 def testGnuplotOutput(self):
     f = Mock(fileType = "gpi")
     # Check with double quotes
     lines = ["set terminal wxt",
         "set output \"test.tex\"",
         "plot f(x)"]
     res = gnuplotOutput.check(f, lines)
     assert(res != None and len(res.targets) == 1 and res.targets[0] == "test.tex" and res.command == "gnuplot " + config.startFilePlaceholder)
     # Check with single quotes
     lines = ["set output 'test.tex'"]
     res = gnuplotOutput.check(f, lines)
     assert(res != None and len(res.targets) == 1 and res.targets[0] == "test.tex" and res.command == "gnuplot " + config.startFilePlaceholder)
     # Dynamic output string -> No dependency
     lines = ["set output 'test'.x.'.tex'"]
     res = gnuplotOutput.check(f, lines)
     assert(res == None)
     # No output string -> No dependency
     lines = ["set terminal wxt", "plot f(x)"]
     res = gnuplotOutput.check(f, lines)
     assert(res == None)