Use the 'with' statement for opening files.

This avoids ResourceWarnings on Python 3.x and leaking file descriptors on PyPy.
Remove reduntant 'strip'.

'split' already ignores leading and trailing whitespace.
Do not make a dot into a magical wildcard character.
Keep the indentation visually clear in the test.

Remove leading whitespace programmatically with textwrap.dedent.