Esempio n. 1
0
class TestNoent(unittest.TestCase):

    def setUp(self):
        import graphviz.files
        graphviz.files.ENGINES.add('spam')
        self.file = File('spam.gv', 'test-output', engine='spam')
        self.file.source = 'spam'

    def tearDown(self):
        import graphviz.files
        graphviz.files.ENGINES.discard('spam')

    def test_render(self):
        with self.assertRaisesRegexp(RuntimeError, 'failed to execute'):
            self.file.render()
Esempio n. 2
0
class TestNoent(unittest.TestCase):
    def setUp(self):
        import graphviz.files
        graphviz.files.ENGINES.add('spam')
        self.file = File('spam.gv', 'test-output', engine='spam')
        self.file.source = 'spam'

    def tearDown(self):
        import graphviz.files
        graphviz.files.ENGINES.discard('spam')

    def test_pipe(self):
        with self.assertRaisesRegexp(RuntimeError, 'failed to execute'):
            self.file.pipe()

    def test_render(self):
        with self.assertRaisesRegexp(RuntimeError, 'failed to execute'):
            self.file.render()
Esempio n. 3
0
class TestNoent(unittest.TestCase):
    def setUp(self):
        import graphviz.files

        graphviz.files.ENGINES.add("spam")
        self.file = File("spam.gv", "test-output", engine="spam")
        self.file.source = "spam"

    def tearDown(self):
        import graphviz.files

        graphviz.files.ENGINES.discard("spam")

    def test_pipe(self):
        with self.assertRaisesRegexp(RuntimeError, "failed to execute"):
            self.file.pipe()

    def test_render(self):
        with self.assertRaisesRegexp(RuntimeError, "failed to execute"):
            self.file.render()
Esempio n. 4
0
class TestNoent(unittest.TestCase):
    def setUp(self):
        self._oldpath = os.environ.get('PATH')
        os.environ['PATH'] = ''
        self.file = File('spam.gv', 'test-output')
        self.file.source = 'spam'

    def tearDown(self):
        if self._oldpath is None:
            del os.environ['PATH']
        else:
            os.environ['PATH'] = self._oldpath

    def test_pipe(self):
        with self.assertRaisesRegexp(RuntimeError, 'failed to execute'):
            self.file.pipe()

    def test_render(self):
        with self.assertRaisesRegexp(RuntimeError, 'failed to execute'):
            self.file.render()
Esempio n. 5
0
 def setUp(self):
     self._oldpath = os.environ.get('PATH')
     os.environ['PATH'] = ''
     self.file = File('spam.gv', 'test-output')
     self.file.source = 'spam'
Esempio n. 6
0
 def test_init(self):
     f = File('name', 'dir', 'PNG', 'NEATO', 'latin1')
     self.assertEqual(f.filename, 'name')
     self.assertEqual(f.format, 'png')
     self.assertEqual(f.engine, 'neato')
     self.assertEqual(f.encoding, 'latin1')
Esempio n. 7
0
 def setUp(self):
     self.file = File()
Esempio n. 8
0
    def setUp(self):
        import graphviz.files

        graphviz.files.ENGINES.add("spam")
        self.file = File("spam.gv", "test-output", engine="spam")
        self.file.source = "spam"
Esempio n. 9
0
 def setUp(self):
     import graphviz.files
     graphviz.files.ENGINES.add('spam')
     self.file = File('spam.gv', 'test-output', engine='spam')
     self.file.source = 'spam'
Esempio n. 10
0
 def setUp(self):
     import graphviz.files
     graphviz.files.ENGINES.add('spam')
     self.file = File('spam.gv', 'test-output', engine='spam')
     self.file.source = 'spam'