1
1
import pytest
2
2
from qtpy .QtCore import QSize
3
3
4
- from napari_matplotlib .util import Interval , from_css_get_size_of
4
+ from napari_matplotlib .util import Interval , from_napari_css_get_size_of
5
5
6
6
7
7
def test_interval ():
@@ -28,19 +28,19 @@ def test_get_size_from_css(mocker):
28
28
}
29
29
"""
30
30
mocker .patch ("napari.qt.get_current_stylesheet" ).return_value = test_css
31
- assert from_css_get_size_of ("Flibble" , (1 , 2 )) == QSize (123 , 456 )
31
+ assert from_napari_css_get_size_of ("Flibble" , (1 , 2 )) == QSize (123 , 456 )
32
32
33
33
34
34
def test_fallback_if_missing_dimensions (mocker ):
35
35
"""Test fallback if given something that doesn't have dimensions"""
36
36
test_css = " Flobble { background-color: rgb(0, 97, 163); } "
37
37
mocker .patch ("napari.qt.get_current_stylesheet" ).return_value = test_css
38
38
with pytest .warns (RuntimeWarning , match = "Unable to find DimensionToken" ):
39
- assert from_css_get_size_of ("Flobble" , (1 , 2 )) == QSize (1 , 2 )
39
+ assert from_napari_css_get_size_of ("Flobble" , (1 , 2 )) == QSize (1 , 2 )
40
40
41
41
42
42
def test_fallback_if_prelude_not_in_css ():
43
43
"""Test fallback if given something not in the css"""
44
44
doesntexist = "AQButtonThatDoesntExist"
45
45
with pytest .warns (RuntimeWarning , match = f"Unable to find { doesntexist } " ):
46
- assert from_css_get_size_of (doesntexist , (1 , 2 )) == QSize (1 , 2 )
46
+ assert from_napari_css_get_size_of (doesntexist , (1 , 2 )) == QSize (1 , 2 )
0 commit comments