Add context manager integration test

Reference #1