Example #1
0
 def test_present_xdot(self):
     self.programsInPath(['xdot'])
     objgraph._present_graph('foo.dot')
     self.assertOutput("""
         Spawning graph viewer (xdot)
         subprocess.Popen(['xdot', 'foo.dot'])
     """)
Example #2
0
 def test_present_xdot(self):
     self.programsInPath(['xdot'])
     objgraph._present_graph('foo.dot')
     self.assertOutput("""
         Spawning graph viewer (xdot)
         subprocess.Popen(['xdot', 'foo.dot'])
     """)
Example #3
0
 def test_present_png_no_dot(self):
     self.programsInPath([])
     objgraph._present_graph('foo.dot', 'bar.png')
     self.assertOutput("""
         Image renderer (dot) not found, not doing anything else
     """)
     self.assertFalse(os.path.exists('bar.png'))
Example #4
0
 def test_present_png(self):
     self.programsInPath(['dot'])
     objgraph._present_graph('foo.dot', 'bar.png')
     self.assertOutput("""
         subprocess.Popen(['dot', '-Tpng', '-obar.png', 'foo.dot'])
         Image generated as bar.png
     """)
Example #5
0
 def test_present_png_no_dot(self):
     self.programsInPath([])
     objgraph._present_graph('foo.dot', 'bar.png')
     self.assertOutput("""
         Image renderer (dot) not found, not doing anything else
     """)
     self.assertFalse(os.path.exists('bar.png'))
Example #6
0
 def test_present_png(self):
     self.programsInPath(['dot'])
     objgraph._present_graph('foo.dot', 'bar.png')
     self.assertOutput("""
         subprocess.Popen(['dot', '-Tpng', '-obar.png', 'foo.dot'])
         Image generated as bar.png
     """)
Example #7
0
 def test_present_no_xdot(self):
     self.programsInPath(['dot'])
     objgraph._present_graph('foo.dot')
     self.assertOutput("""
         Graph viewer (xdot) not found, generating a png instead
         subprocess.Popen(['dot', '-Tpng', '-ofoo.png', 'foo.dot'])
         Image generated as foo.png
     """)
Example #8
0
 def test_present_png_failure(self):
     self.programsInPath(['dot'])
     objgraph.subprocess.should_fail = True
     objgraph._present_graph('f.dot', 'b.png')
     self.assertOutput("""
         subprocess.Popen(['dot', '-Tpng', '-ob.png', 'f.dot'])
         dot failed (exit code 1) while executing "dot -Tpng -ob.png f.dot"
     """)
Example #9
0
 def test_present_no_xdot(self):
     self.programsInPath(['dot'])
     objgraph._present_graph('foo.dot')
     self.assertOutput("""
         Graph viewer (xdot) not found, generating a png instead
         subprocess.Popen(['dot', '-Tpng', '-ofoo.png', 'foo.dot'])
         Image generated as foo.png
     """)
Example #10
0
 def test_present_png_failure(self):
     self.programsInPath(['dot'])
     objgraph.subprocess.should_fail = True
     objgraph._present_graph('f.dot', 'b.png')
     self.assertOutput("""
         subprocess.Popen(['dot', '-Tpng', '-ob.png', 'f.dot'])
         dot failed (exit code 1) while executing "dot -Tpng -ob.png f.dot"
     """)
Example #11
0
 def test_present_no_xdot_and_no_not(self):
     self.programsInPath([])
     objgraph._present_graph('foo.dot')
     self.assertOutput("Graph viewer (xdot) and image renderer (dot)"
                       " not found, not doing anything else\n")
Example #12
0
 def test_present_dot(self):
     objgraph._present_graph('foo.dot', 'foo.dot')
     self.assertOutput("")
Example #13
0
 def test_present_no_xdot_and_no_not(self):
     self.programsInPath([])
     objgraph._present_graph('foo.dot')
     self.assertOutput("Graph viewer (xdot) and image renderer (dot)"
                       " not found, not doing anything else\n")
Example #14
0
 def test_present_dot(self):
     objgraph._present_graph('foo.dot', 'foo.dot')
     self.assertOutput("")