tests: connection refactor.
add back error handling.
Merge pull request #148 from stephenplusplus/connection-tests

tests: connection refactor.