예제 #1
0
파일: main.py 프로젝트: vsham20/sushy
    def get_session(self, identity):
        """Given the identity return a Session object

        :param identity: The identity of the session resource
        :returns: The Session object
        """
        return session.Session(self._conn, identity,
                               redfish_version=self.redfish_version)
예제 #2
0
    def setUp(self):
        super(SessionTestCase, self).setUp()
        self.conn = mock.Mock()
        self.auth = mock.Mock()
        with open('sushy/tests/unit/json_samples/session.json') as f:
            self.json_doc = json.load(f)
            self.conn.get.return_value.json.return_value = self.json_doc
            self.auth._session_key = 'fake_x_auth_token'
            self.auth._session_uri = self.json_doc['@odata.id']
            self.conn._auth = self.auth

        self.sess_inst = session.Session(
            self.conn,
            '/redfish/v1/SessionService/Sessions/1234567890ABCDEF',
            redfish_version='1.0.2')