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 9c3e1c1 commit b4e21daCopy full SHA for b4e21da
tests/test_widgets.py
@@ -0,0 +1,24 @@
1
+import pytest
2
+
3
+from PyQt5.QtWidgets import QWidget
4
+from PyQt5.QtTest import QTest
5
6
+from slice.ui.widgets import DragDropLineEdit
7
8
9
+def test_drag_drop_line_edit(qtbot):
10
+ widget1 = QWidget()
11
+ widget2 = DragDropLineEdit(widget1)
12
+ # placeholder text
13
+ assert (
14
+ widget2.placeholderText() == "Drop a variable font here or click the Open button"
15
+ )
16
+ assert widget2.isEnabled() is True
17
+ # accepts drops
18
+ assert widget2.acceptDrops() is True
19
+ # uses a clear button
20
+ assert widget2.isClearButtonEnabled() is True
21
+ # test text entry
22
+ assert widget2.text() == ""
23
+ QTest.keyClicks(widget2, "test")
24
+ assert widget2.text() == "test"
0 commit comments