Testing Python patterns