wipworking

This commit is contained in:
2025-10-09 10:59:00 +02:00
parent 0e9a655ea1
commit a1556ebce3
31 changed files with 113 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -2,12 +2,40 @@
Utility modules for the Text Texture Generator addon.
"""
from .constants import bl_info
from .constants import (
bl_info,
has_image_overlays,
has_basic_utilities,
has_presets,
has_normal_maps,
has_batch_processing,
has_advanced_utilities,
has_advanced_styling,
has_stroke_effects,
has_blur_effects,
has_shadow_glow_effects,
has_shader_generation,
is_free_version,
is_full_version
)
from .system import install_pillow, get_system_fonts, get_font_enum_items
__all__ = [
'bl_info',
'install_pillow',
'get_system_fonts',
'get_font_enum_items'
'get_font_enum_items',
'has_image_overlays',
'has_basic_utilities',
'has_presets',
'has_normal_maps',
'has_batch_processing',
'has_advanced_utilities',
'has_advanced_styling',
'has_stroke_effects',
'has_blur_effects',
'has_shadow_glow_effects',
'has_shader_generation',
'is_free_version',
'is_full_version'
]

Binary file not shown.

View File

@@ -0,0 +1,82 @@
"""
Test to reproduce the has_image_overlays import error.
This test verifies that has_image_overlays can be imported from utils.constants.
"""
import pytest
def test_has_image_overlays_importable_from_constants():
"""Test that has_image_overlays can be imported from utils.constants"""
try:
from src.utils.constants import has_image_overlays
assert callable(has_image_overlays), "has_image_overlays should be a callable function"
except ImportError as e:
pytest.fail(f"Failed to import has_image_overlays from utils.constants: {e}")
def test_has_image_overlays_returns_boolean():
"""Test that has_image_overlays returns a boolean value"""
from src.utils.constants import has_image_overlays
result = has_image_overlays()
assert isinstance(result, bool), f"has_image_overlays() should return bool, got {type(result)}"
def test_panels_can_import_has_image_overlays():
"""Test that panels.py can successfully import has_image_overlays"""
try:
# Simulate the import as it appears in panels.py line 13
from src.utils.constants import (
is_free_version, get_version_badge_text, get_version_badge_icon,
get_upgrade_hint_text, should_show_feature_lock,
get_feature_availability_text, get_version_info_details,
has_image_overlays, has_basic_utilities, has_presets,
has_normal_maps, has_batch_processing, has_advanced_utilities,
has_advanced_styling
)
# Verify has_image_overlays is imported
assert has_image_overlays is not None
assert callable(has_image_overlays)
except ImportError as e:
pytest.fail(f"panels.py-style import failed: {e}")
def test_all_feature_check_functions_importable():
"""Test that all feature check functions can be imported"""
try:
from src.utils.constants import (
has_image_overlays,
has_basic_utilities,
has_presets,
has_normal_maps,
has_batch_processing,
has_advanced_utilities,
has_advanced_styling,
has_stroke_effects,
has_blur_effects,
has_shadow_glow_effects,
has_shader_generation
)
# Verify all are callable
functions = [
has_image_overlays,
has_basic_utilities,
has_presets,
has_normal_maps,
has_batch_processing,
has_advanced_utilities,
has_advanced_styling,
has_stroke_effects,
has_blur_effects,
has_shadow_glow_effects,
has_shader_generation
]
for func in functions:
assert callable(func), f"{func.__name__} should be callable"
except ImportError as e:
pytest.fail(f"Failed to import feature check functions: {e}")