first unit tests for pattern.py