working
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user