@ -10,8 +10,12 @@ def test_display_label_for_modal():
y_label = axis_classifier . display_label_for_modal ( None , " y " )
y_label = axis_classifier . display_label_for_modal ( None , " y " )
# Should return component 1 and 2 labels from SVD_THEMES
# Should return component 1 and 2 labels from SVD_THEMES
assert " Rechts versus links " in x_label or " links " in x_label . lower ( )
# SVD_THEMES[0] = "Economische sectorbelangen versus sociale welvaart"
assert " Nationalistisch " in y_label or " kosmopolitisch " in y_label
# SVD_THEMES[1] = "Nationalistische versus multilateralistische oriëntatie"
assert (
" Economische sectorbelangen " in x_label or " sectorbelangen " in x_label . lower ( )
)
assert " Nationalistisch " in y_label or " nationalistisch " in y_label . lower ( )
def test_display_label_for_modal_maps_as_labels ( ) :
def test_display_label_for_modal_maps_as_labels ( ) :
@ -19,9 +23,11 @@ def test_display_label_for_modal_maps_as_labels():
x_label = axis_classifier . display_label_for_modal ( " As 1 " , " x " )
x_label = axis_classifier . display_label_for_modal ( " As 1 " , " x " )
y_label = axis_classifier . display_label_for_modal ( " As 2 " , " y " )
y_label = axis_classifier . display_label_for_modal ( " As 2 " , " y " )
# Should return component 1 and 2 labels
# Should return component 1 and 2 labels from SVD_THEMES
assert " Rechts versus links " in x_label or " links " in x_label . lower ( )
assert (
assert " Nationalistisch " in y_label or " kosmopolitisch " in y_label
" Economische sectorbelangen " in x_label or " sectorbelangen " in x_label . lower ( )
)
assert " Nationalistisch " in y_label or " nationalistisch " in y_label . lower ( )
def test_display_label_for_modal_stempatroon ( ) :
def test_display_label_for_modal_stempatroon ( ) :
@ -29,9 +35,11 @@ def test_display_label_for_modal_stempatroon():
x_label = axis_classifier . display_label_for_modal ( " Stempatroon As 1 " , " x " )
x_label = axis_classifier . display_label_for_modal ( " Stempatroon As 1 " , " x " )
y_label = axis_classifier . display_label_for_modal ( " Stempatroon As 2 " , " y " )
y_label = axis_classifier . display_label_for_modal ( " Stempatroon As 2 " , " y " )
# Should return component 1 and 2 labels
# Should return component 1 and 2 labels from SVD_THEMES
assert " Rechts versus links " in x_label or " links " in x_label . lower ( )
assert (
assert " Nationalistisch " in y_label or " kosmopolitisch " in y_label
" Economische sectorbelangen " in x_label or " sectorbelangen " in x_label . lower ( )
)
assert " Nationalistisch " in y_label or " nationalistisch " in y_label . lower ( )
def test_classify_axes_modal_fallback ( monkeypatch , tmp_path ) :
def test_classify_axes_modal_fallback ( monkeypatch , tmp_path ) :
@ -82,12 +90,12 @@ def test_classify_axes_modal_fallback(monkeypatch, tmp_path):
if not enriched or not isinstance ( enriched , dict ) :
if not enriched or not isinstance ( enriched , dict ) :
pytest . skip ( " classify_axes returned no enrichment in this environment " )
pytest . skip ( " classify_axes returned no enrichment in this environment " )
# Should now return SVD component labels instead of hardcoded values
# Should now return SVD component labels from SVD_THEMES
assert (
assert (
" Rechts versus links " in enriched [ " x_label " ]
" Economische sectorbelangen " in enriched [ " x_label " ]
or " links " in enriched [ " x_label " ] . lower ( )
or " sectorbelangen " in enriched [ " x_label " ] . lower ( )
)
)
assert (
assert (
" Nationalistisch " in enriched [ " y_label " ]
" Nationalistisch " in enriched [ " y_label " ]
or " kosmopoli tisch" in enriched [ " y_label " ]
or " nationalis tisch" in enriched [ " y_label " ] . lower ( )
)
)