This commit is contained in:
2025-10-13 16:56:38 +02:00
parent bf636cbc66
commit 57b55b10a2
21 changed files with 624 additions and 202 deletions

View File

@@ -5,7 +5,7 @@ These tests specify the expected behavior when VERSION_TYPE="free".
They validate that free version users:
1. Can use basic features (text generation, preview)
2. CANNOT access PRO features (shaders, presets, overlays, normal maps)
3. Have REDUCED limits (max_texture_size=1024, max_concurrent=1)
3. Maintain concurrency cap (max_concurrent=1) without texture size limits
4. See UI locks/badges on PRO features
TESTING STRATEGY:
@@ -17,7 +17,7 @@ TESTING STRATEGY:
EXPECTED BEHAVIOR (FREE VERSION):
- ENABLED_FEATURES = ["basic", "preview"] only
- BLOCKED: shader_generation, normal_maps, image_overlays, presets, advanced
- LIMITS: max_texture_size=1024, max_concurrent_operations=1
- LIMITS: Unlimited texture size, max_concurrent_operations=1
- UI: Shows "🔒 PRO" badges on locked features
"""
@@ -411,19 +411,19 @@ print("SUCCESS: Text fitting properly blocked")
assert "SUCCESS: Text fitting properly blocked" in output
def test_free_version_texture_size_limited(blender_container, addon_package):
def test_free_version_allows_large_textures(blender_container, addon_package):
"""
SPECIFICATION: Free version MUST limit max_texture_size to 1024px (not 4096px).
SPECIFICATION UPDATE: Free version should allow large texture dimensions without artificial caps.
Expected behavior (VERSION_TYPE="free"):
- get_version_limits()['max_texture_size'] == 1024
- Attempting 4096px should fail or clamp to 1024
- UI should disable/hide 2048+ size options
- get_version_limits() does NOT define 'max_texture_size'
- Generating a 4096px texture succeeds without clamping
- UI should allow entering high-resolution values
Current state (VERSION_TYPE="full"):
- Test SKIPS (max_texture_size is 4096)
- Test SKIPS (runs only when free build is active)
**CRITICAL BUG**: get_version_limits() currently returns same values for both versions!
**PREVIOUS BUG**: get_version_limits() returned identical caps for both versions.
"""
version_type, enabled_features = get_version_type(blender_container, addon_package)
@@ -438,13 +438,27 @@ import sys
from text_texture_generator.utils.constants import get_version_limits
limits = get_version_limits()
# CRITICAL: This is the BUG - get_version_limits() returns same for both versions!
max_size = limits.get('max_texture_size', 4096)
if max_size != 1024:
print(f"FAIL: max_texture_size should be 1024 for free version, got {max_size}")
# Ensure no artificial texture size cap is reported
max_size = limits.get('max_texture_size')
if max_size:
print(f"FAIL: Expected no texture size cap, got {max_size}")
sys.exit(1)
print(f"SUCCESS: Texture size properly limited to {max_size}px")
# Attempt a large texture generation
props = bpy.context.scene.text_texture_props
props.text = "High Resolution Test"
props.texture_width = 4096
props.texture_height = 4096
try:
bpy.ops.text_texture.generate_shader()
if props.texture_width != 4096 or props.texture_height != 4096:
print(f"FAIL: Texture dimensions were clamped to {props.texture_width}x{props.texture_height}")
sys.exit(1)
print("SUCCESS: Large texture generated without limits")
except Exception as e:
print(f"FAIL: Large texture generation failed: {e}")
sys.exit(1)
"""
tar_stream = io.BytesIO()
@@ -469,7 +483,7 @@ print(f"SUCCESS: Texture size properly limited to {max_size}px")
# This test WILL FAIL because get_version_limits() has the bug
assert test_result.exit_code == 0, f"Size limit test failed:\n{output}"
assert "SUCCESS: Texture size properly limited to 1024px" in output
assert "SUCCESS: Large texture generated without limits" in output
def test_free_version_ui_shows_pro_locks(blender_container, addon_package):
@@ -852,4 +866,3 @@ except ImportError:
assert test_result.exit_code == 0, f"Operator poll test failed:\n{output}"
assert "SUCCESS: has_multiline_text helper removed" in output
assert "SUCCESS: Multiline editor operator removed" in output

View File

@@ -4,7 +4,7 @@ E2E tests for full version feature completeness.
Tests run in Docker with real Blender to verify:
- All features enabled in ENABLED_FEATURES list
- Shader generation works
- Large texture sizes (4096px) supported
- Large texture sizes supported (no artificial cap)
- No UI locks/PRO badges visible
NO MOCKS - real Blender bpy API operations.
@@ -259,15 +259,13 @@ except Exception as e:
assert "SUCCESS: Shader generation works" in output
def test_full_version_large_texture_4096px(
def test_full_version_supports_large_textures(
blender_container,
addon_package,
tmp_path
):
"""
Verify large texture size (4096px) works - this is the full version limit.
Full version should support up to 4096px.
Verify large texture sizes work without an explicit limit in the full version.
"""
script_content = """
import bpy
@@ -284,19 +282,20 @@ except Exception as e:
try:
from text_texture_generator.utils.constants import get_version_limits
# Verify max texture size
limits = get_version_limits()
max_size = limits.get('max_texture_size', 0)
max_size = limits.get('max_texture_size')
if max_size != 4096:
print(f"FAIL: Expected max_texture_size=4096, got {max_size}")
if max_size:
print(f"FAIL: Expected unlimited texture size, got {max_size}")
sys.exit(1)
# For now, just verify the limit and produce expected output
# Full integration test would require registered properties
print("Texture size: 4096x4096")
print("Image has pixel data")
print("SUCCESS: 4096px texture generated")
props = bpy.context.scene.text_texture_props
props.text = "Full Version High Resolution"
props.texture_width = 4096
props.texture_height = 4096
bpy.ops.text_texture.generate_shader()
print(f"Texture size: {props.texture_width}x{props.texture_height}")
print("SUCCESS: Full version large texture generated")
except Exception as e:
print(f"ERROR: {e}")
@@ -374,8 +373,7 @@ except Exception as e:
)
assert "Texture size: 4096x4096" in output
assert "Image has pixel data" in output
assert "SUCCESS: 4096px texture generated" in output
assert "SUCCESS: Full version large texture generated" in output
def test_full_version_no_ui_locks(
@@ -407,11 +405,11 @@ try:
# Check version limits
limits = get_version_limits()
max_size = limits.get('max_texture_size', 0)
max_size = limits.get('max_texture_size')
print(f"MAX_TEXTURE_SIZE: {max_size}")
if max_size != 4096:
print(f"FAIL: Expected max_texture_size=4096, got {max_size}")
if max_size:
print(f"FAIL: Expected no texture size limit, got {max_size}")
sys.exit(1)
# Check if PRO features are locked
@@ -431,6 +429,9 @@ try:
# For now, just verify limits without accessing unregistered properties
# Full integration test would require registered properties
props = bpy.context.scene.text_texture_props
props.texture_width = 4096
props.texture_height = 4096
print(f"Can set 4096px: True")
print("SUCCESS: UI is fully unlocked")
@@ -511,7 +512,7 @@ except Exception as e:
)
assert "VERSION_TYPE: full" in output
assert "MAX_TEXTURE_SIZE: 4096" in output
assert "MAX_TEXTURE_SIZE: None" in output
assert "has_pro_locks: False" in output
assert "Can set 4096px: True" in output