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()