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()
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()
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()
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()
def setUp(self): self._oldpath = os.environ.get('PATH') os.environ['PATH'] = '' self.file = File('spam.gv', 'test-output') self.file.source = 'spam'
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')
def setUp(self): self.file = File()
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 setUp(self): import graphviz.files graphviz.files.ENGINES.add('spam') self.file = File('spam.gv', 'test-output', engine='spam') self.file.source = 'spam'