def sessions(self): """Property to provide reference to the `SessionCollection` instance It is calculated once when the first time it is queried. On refresh, this property gets reset. """ return session.SessionCollection(self._conn, self._get_sessions_collection_path(), redfish_version=self.redfish_version)
def setUp(self): super(SessionCollectionTestCase, self).setUp() self.conn = mock.Mock() js_f = 'sushy/tests/unit/json_samples/session_collection.json' with open(js_f, 'r') as f: self.conn.get.return_value.json.return_value = json.loads(f.read()) self.sess_col = session.SessionCollection( self.conn, '/redfish/v1/SessionService/Sessions', redfish_version='1.0.2')
def setUp(self): super(SessionCollectionTestCase, self).setUp() self.conn = mock.Mock() with open('sushy/tests/unit/json_samples/' 'session_collection.json') as f: self.json_doc = json.load(f) self.conn.get.return_value.json.return_value = self.json_doc self.sess_col = session.SessionCollection( self.conn, '/redfish/v1/SessionService/Sessions', redfish_version='1.0.2')