28 lines
1001 B
Python
28 lines
1001 B
Python
"""Round 82: the list frame closes above album art too."""
|
|
from PyQt6.QtGui import QColor, QPixmap
|
|
|
|
from tests.test_round80 import _sidebar
|
|
|
|
|
|
def test_art_draws_the_frames_closing_line(qapp, tmp_path):
|
|
"""A white cover inside the list's frame starts under a line in the
|
|
frame's own color, not straight on from the list."""
|
|
from lintunes.gui.sidebar import ART_RULE
|
|
window, sidebar = _sidebar(qapp, tmp_path)
|
|
art = sidebar.art
|
|
pixmap = QPixmap(10, 10)
|
|
pixmap.fill(QColor("white"))
|
|
art._pixmap = pixmap
|
|
art.has_art_changed.emit(True)
|
|
art._fit_height()
|
|
qapp.processEvents()
|
|
group = sidebar.list_area.grab().toImage()
|
|
# the frame's own left edge, halfway down the list
|
|
frame = group.pixelColor(0, group.height() // 4)
|
|
image = art.grab().toImage()
|
|
middle = image.width() // 2
|
|
for y in range(ART_RULE):
|
|
assert image.pixelColor(middle, y) == frame
|
|
assert image.pixelColor(middle, ART_RULE) == QColor("white")
|
|
window.close()
|