test: verify MARLIN 4 smart fallback working correctly
Browse files- MARLIN 4 search now shows MARLIN 4 GEN 3 (2026) automatically
- Smart model detection prioritizes newer models when original is out of stock
- Price formatting with Trek algorithm (42.000 TL)
- Stock details show store locations and variants properly
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
- __pycache__/combined_api_search.cpython-312.pyc +0 -0
- test_api_image.py +31 -0
- test_marlin_4.py +17 -0
__pycache__/combined_api_search.cpython-312.pyc
CHANGED
|
Binary files a/__pycache__/combined_api_search.cpython-312.pyc and b/__pycache__/combined_api_search.cpython-312.pyc differ
|
|
|
test_api_image.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# Test combined API for image data
|
| 3 |
+
|
| 4 |
+
import requests
|
| 5 |
+
import xml.etree.ElementTree as ET
|
| 6 |
+
|
| 7 |
+
try:
|
| 8 |
+
response = requests.get('https://video.trek-turkey.com/combined_trek_xml_api_v2.php')
|
| 9 |
+
root = ET.fromstring(response.content)
|
| 10 |
+
|
| 11 |
+
products = root.findall('product')
|
| 12 |
+
print(f"Total products found: {len(products)}")
|
| 13 |
+
|
| 14 |
+
# Marlin 6 ara
|
| 15 |
+
for product in products:
|
| 16 |
+
name = product.find('name')
|
| 17 |
+
if name is not None and 'MARLIN 6' in name.text:
|
| 18 |
+
print(f"Found: {name.text}")
|
| 19 |
+
|
| 20 |
+
image_url = product.find('image_url')
|
| 21 |
+
if image_url is not None:
|
| 22 |
+
print(f"Image URL: {image_url.text}")
|
| 23 |
+
print(f"Has Image: {bool(image_url.text)}")
|
| 24 |
+
else:
|
| 25 |
+
print("Image URL element not found in XML")
|
| 26 |
+
break
|
| 27 |
+
else:
|
| 28 |
+
print("No Marlin 6 found in API")
|
| 29 |
+
|
| 30 |
+
except Exception as e:
|
| 31 |
+
print(f"Error: {e}")
|
test_marlin_4.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# Test MARLIN 4 smart fallback
|
| 3 |
+
|
| 4 |
+
import sys
|
| 5 |
+
import os
|
| 6 |
+
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
| 7 |
+
|
| 8 |
+
from combined_api_search import get_warehouse_stock_combined_api
|
| 9 |
+
|
| 10 |
+
print("Testing MARLIN 4 search...")
|
| 11 |
+
results = get_warehouse_stock_combined_api("marlin 4")
|
| 12 |
+
|
| 13 |
+
if results:
|
| 14 |
+
for i, result in enumerate(results[:3], 1):
|
| 15 |
+
print(f"\n{i}. {result}")
|
| 16 |
+
else:
|
| 17 |
+
print("No results found")
|