Skip to content

Commit

Permalink
Create corpus - fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimozGodec committed Mar 7, 2023
1 parent 9e795be commit ed68d54
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions orangecontrib/text/widgets/tests/test_owcreatecorpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,29 @@ def test_add_remove_editors(self):
self.assertEqual(5, len(self.widget.texts))
self.assertListEqual([("", "")] * 5, self.widget.texts)

# click any button in editor_vbox - there are only buttons for removing
self.widget.editor_vbox.findChild(QPushButton).click()
# click x button for first editor
self.widget.editors[0].findChild(QPushButton).click()
self.assertEqual(4, len(self.widget.editors))
self.assertEqual(4, len(self.widget.texts))
self.assertListEqual([("", "")] * 4, self.widget.texts)

self.widget.editor_vbox.findChild(QPushButton).click()
self.widget.editors[0].findChild(QPushButton).click()
self.assertEqual(3, len(self.widget.editors))
self.assertEqual(3, len(self.widget.texts))
self.assertListEqual([("", "")] * 3, self.widget.texts)

self.widget.editor_vbox.findChild(QPushButton).click()
self.widget.editors[0].findChild(QPushButton).click()
self.assertEqual(2, len(self.widget.editors))
self.assertEqual(2, len(self.widget.texts))
self.assertListEqual([("", "")] * 2, self.widget.texts)

self.widget.editor_vbox.findChild(QPushButton).click()
self.widget.editors[0].findChild(QPushButton).click()
self.assertEqual(1, len(self.widget.editors))
self.assertEqual(1, len(self.widget.texts))
self.assertListEqual([("", "")], self.widget.texts)

# last editor cannot be removed
self.widget.editor_vbox.findChild(QPushButton).click()
self.widget.editors[0].findChild(QPushButton).click()
self.assertEqual(1, len(self.widget.editors))
self.assertEqual(1, len(self.widget.texts))
self.assertListEqual([("", "")], self.widget.texts)
Expand Down

0 comments on commit ed68d54

Please sign in to comment.