refactored test_patterns to test_neighbordb