-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd738d9
commit b2ed7e3
Showing
5 changed files
with
91 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pytest | ||
|
||
from src.core.library import ItemType | ||
from src.qt.widgets.item_thumb import ItemThumb | ||
|
||
|
||
@pytest.mark.parametrize("toggle_value", (True, False)) | ||
def test_toggle_favorite(qtbot, qt_driver, toggle_value): | ||
# panel = PreviewPanel(qt_driver.lib, qt_driver) | ||
|
||
entry = qt_driver.lib.entries[0] | ||
|
||
qt_driver.frame_content = [entry] | ||
qt_driver.selected = [0] | ||
|
||
thumb = ItemThumb(ItemType.ENTRY, qt_driver.lib, qt_driver, (100, 100)) | ||
|
||
qtbot.addWidget(thumb) | ||
|
||
thumb.on_favorite_check(toggle_value) | ||
|
||
# reload entry | ||
entry = qt_driver.lib.entries[0] | ||
|
||
# check entry has favorite tag in meta tags field | ||
assert entry.is_favorited == toggle_value |