File size: 1,215 Bytes
e8510d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import logging
import json
import requests
from app import get_first_els_result_matthew, calculate_gematria
import bible

# Set up logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)

# Test values
test_gematria_sum = 5642  # Same as in your test

# Test with both API and direct function call
logger.info("Testing API endpoint...")
response = requests.get(f"http://localhost:10000/api/bible", params={"name": "", "date": "2025-06-07"})
api_result = response.json()
logger.info(f"API result: {json.dumps(api_result['els_result'], indent=2)}")

# Test direct function call
logger.info(f"\nTesting get_first_els_result_matthew with sum {test_gematria_sum}...")
matthew_result = get_first_els_result_matthew(test_gematria_sum)

if matthew_result:
    logger.info(f"Function result: {json.dumps({k:v for k,v in matthew_result.items() if k != 'result_text'}, indent=2)}")
    logger.info(f"Text: {matthew_result['result_text'][:20]}...")
    logger.info(f"Round: {matthew_result.get('round')}")
    logger.info(f"Step: {matthew_result.get('step')}")
    logger.info(f"Gematria: {calculate_gematria(matthew_result['result_text'])}")
else:
    logger.info("No result found from Matthew")