|
|
|
|
|
|
|
import sys |
|
import os |
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) |
|
|
|
|
|
from app import get_warehouse_stock |
|
|
|
if __name__ == "__main__": |
|
test_cases = [ |
|
"M Turuncu", |
|
"Marlin 6 M Turuncu", |
|
"Marlin M Turuncu", |
|
"L Siyah", |
|
"Marlin 6 L Siyah" |
|
] |
|
|
|
for test_case in test_cases: |
|
print(f"\n=== Testing: {test_case} ===") |
|
try: |
|
result = get_warehouse_stock(test_case) |
|
if result: |
|
print("Sonuç:") |
|
total_stock = 0 |
|
for item in result: |
|
print(f" • {item}") |
|
|
|
if ": " in item and " adet" in item: |
|
stock_part = item.split(": ")[1].replace(" adet", "") |
|
try: |
|
total_stock += int(stock_part) |
|
except: |
|
pass |
|
print(f"TOPLAM: {total_stock} adet") |
|
else: |
|
print("Sonuç bulunamadı") |
|
except Exception as e: |
|
print(f"Hata: {e}") |
|
print("-" * 50) |