We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 817afcc commit 589f403Copy full SHA for 589f403
Orange/widgets/tests/test_io.py
@@ -0,0 +1,20 @@
1
+import os
2
+import tempfile
3
+import unittest
4
+
5
+from AnyQt.QtWidgets import QGraphicsScene, QGraphicsRectItem
6
+from Orange.widgets.tests.base import GuiTest
7
8
+from Orange.widgets import io as imgio
9
10
+@unittest.skipUnless(hasattr(imgio, "PdfFormat"), "QPdfWriter not available")
11
+class TestIO(GuiTest):
12
+ def test_pdf(self):
13
+ sc = QGraphicsScene()
14
+ sc.addItem(QGraphicsRectItem(0, 0, 20, 20))
15
+ fd, fname = tempfile.mkstemp()
16
+ os.close(fd)
17
+ try:
18
+ imgio.PdfFormat.write_image(fname, sc)
19
+ finally:
20
+ os.unlink(fname)
0 commit comments