File: test_init.py

package info (click to toggle)
textual-image 0.8.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,468 kB
  • sloc: python: 1,851; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 604 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from importlib import reload
from unittest import skipUnless
from unittest.mock import patch

from tests.data import TEXTUAL_ENABLED


@skipUnless(TEXTUAL_ENABLED, "Textual support disabled")
def test_determining_best_widget_as_sixel() -> None:
    import textual_image.renderable
    import textual_image.widget
    from textual_image.renderable.sixel import Image as SixelRenderable
    from textual_image.widget.sixel import Image as SixelImage

    with patch("textual_image.renderable.Image", SixelRenderable):
        module = reload(textual_image.widget)
        assert module.Image is SixelImage