def test_peer_credentials(self):
        base = session.SessionBase()
        self.assertIsNone(base.peer_credentials)

        cred = keychain.Credentials('me', keychain.BaseKeypair())

        base = session.SessionBase(peer_credentials=cred)
        self.assertIsInstance(base.peer_credentials, list)

        base = session.SessionBase(peer_credentials=[cred])
        self.assertIsInstance(base.peer_credentials, list)
 def test_authentication_error(self, mock_request):
     base = session.SessionBase()
     self.assertRaises(exceptions.InvalidAuthentication,
                       base.make_http_request, "GET",
                       "https://myservice/unauthorized")
 def test_invalid_method(self):
     base = session.SessionBase()
     self.assertRaises(TypeError, base.make_http_request, "UNKOWN",
                       "http://localhost:8080")