()
| 27 | pass |
| 28 | |
| 29 | def test_sdk_initialization(): |
| 30 | print('📋 Testing SDK Initialization...\n') |
| 31 | |
| 32 | # Test 1: Should fail without required config |
| 33 | try: |
| 34 | OpenMemory() |
| 35 | assert_test(False, 'Should throw error without required config') |
| 36 | except ValueError: |
| 37 | assert_test(True, 'Correctly throws error without required config') |
| 38 | |
| 39 | # Test 2: Should fail without path |
| 40 | try: |
| 41 | OpenMemory(tier='fast', embeddings={'provider': 'synthetic'}) |
| 42 | assert_test(False, 'Should throw error without path') |
| 43 | except ValueError as e: |
| 44 | assert_test('requires "path"' in str(e), 'Error message mentions missing path') |
| 45 | |
| 46 | # Test 3: Should fail without tier |
| 47 | try: |
| 48 | OpenMemory(path=TEST_DB_PATH, embeddings={'provider': 'synthetic'}) |
| 49 | assert_test(False, 'Should throw error without tier') |
| 50 | except ValueError as e: |
| 51 | assert_test('requires "tier"' in str(e), 'Error message mentions missing tier') |
| 52 | |
| 53 | # Test 4: Should fail without embeddings |
| 54 | try: |
| 55 | OpenMemory(path=TEST_DB_PATH, tier='fast') |
| 56 | assert_test(False, 'Should throw error without embeddings') |
| 57 | except ValueError as e: |
| 58 | assert_test('embeddings' in str(e), 'Error message mentions missing embeddings') |
| 59 | |
| 60 | # Test 5: Should initialize with proper config |
| 61 | try: |
| 62 | mem = OpenMemory( |
| 63 | path=TEST_DB_PATH, |
| 64 | tier='fast', |
| 65 | embeddings={'provider': 'synthetic'} |
| 66 | ) |
| 67 | assert_test(mem is not None, 'Successfully initializes with proper config') |
| 68 | mem.close() |
| 69 | except Exception as e: |
| 70 | assert_test(False, f'Initialization failed: {str(e)}') |
| 71 | |
| 72 | def test_memory_operations(): |
| 73 | print('\n🧠 Testing Memory Operations...\n') |
no test coverage detected