musicbrainz-cleaner/src/tests/debug/minimal_test.py

53 lines
1.7 KiB
Python

#!/usr/bin/env python3
"""
Minimal test to isolate the tuple error.
"""
import json
from pathlib import Path
def test_minimal():
"""Test the minimal functionality."""
print("🔍 Testing minimal functionality...")
try:
# Test 1: Load known artists
print("1. Loading known artists...")
data_dir = Path("data")
artists_file = data_dir / "known_artists.json"
with open(artists_file, 'r', encoding='utf-8') as f:
data = json.load(f)
artists = data.get('artists', {})
print(f" Artists type: {type(artists)}")
print(f" Artists keys: {list(artists.keys())[:3]}")
# Test 2: Check for AC/DC
print("\n2. Checking for AC/DC...")
if 'AC/DC' in artists:
mbid = artists['AC/DC']
print(f" AC/DC MBID: {mbid} (type: {type(mbid)})")
# Test 3: Try to call .lower() on the MBID
print("\n3. Testing .lower() on MBID...")
try:
lower_mbid = mbid.lower()
print(f" Lower MBID: {lower_mbid}")
except Exception as e:
print(f" Error calling .lower(): {e}")
# Test 4: Check all values
print("\n4. Checking all artist values...")
for name, mbid in list(artists.items())[:5]:
print(f" {name}: {mbid} (type: {type(mbid)})")
if not isinstance(mbid, str):
print(f" ⚠️ Non-string MBID found: {name} = {mbid}")
except Exception as e:
print(f"❌ Error: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
test_minimal()