Added a test for opening a session

There is code to be moved from the test into the session class