File tree Expand file tree Collapse file tree 1 file changed +19
-17
lines changed Expand file tree Collapse file tree 1 file changed +19
-17
lines changed Original file line number Diff line number Diff line change 1
1
import pytest
2
2
3
- from PyQt5 .QtWidgets import QWidget
3
+ from PyQt5 .QtWidgets import QWidget , QApplication
4
4
from PyQt5 .QtTest import QTest
5
5
6
6
from slice .ui .widgets import DragDropLineEdit
7
7
8
8
9
- def test_drag_drop_line_edit ():
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"
9
+ # def test_drag_drop_line_edit(qtbot):
10
+ # app = QApplication()
11
+ # widget1 = QWidget()
12
+ # widget2 = DragDropLineEdit(widget1)
13
+ # qtbot.addWidget(widget1)
14
+ # # placeholder text
15
+ # assert (
16
+ # widget2.placeholderText() == "Drop a variable font here or click the Open button"
17
+ # )
18
+ # assert widget2.isEnabled() is True
19
+ # # accepts drops
20
+ # assert widget2.acceptDrops() is True
21
+ # # uses a clear button
22
+ # assert widget2.isClearButtonEnabled() is True
23
+ # # test text entry
24
+ # assert widget2.text() == ""
25
+ # QTest.keyClicks(widget2, "test")
26
+ # assert widget2.text() == "test"
You can’t perform that action at this time.
0 commit comments