work on tests for pattern.py