def setUp(self): super(EventSubscriptionCollectionTestCase, self).setUp() self.conn = mock.Mock() with open( "rsd_lib/tests/unit/json_samples/v2_1/" "event_destination_collection.json", "r", ) as f: self.conn.get.return_value.json.return_value = json.loads(f.read()) self.conn.post.return_value = request_fakes.fake_request_post( None, headers={ "Location": "https://localhost:8443/redfish/v1/" "EventService/Subscriptions/2" }, ) self.event_subscription_col = event_destination.\ EventDestinationCollection( self.conn, "/redfish/v1/EventService/" "Subscriptions", redfish_version="1.0.2", )
def setUp(self): super(EthernetSwitchStaticMACCollectionTestCase, self).setUp() self.conn = mock.Mock() with open( "rsd_lib/tests/unit/json_samples/v2_1/" "ethernet_switch_static_mac_collection.json", "r", ) as f: self.conn.get.return_value.json.return_value = json.loads(f.read()) self.conn.post.return_value = request_fakes.fake_request_post( None, headers={ "Location": "https://localhost:8443/redfish/v1/" "EthernetSwitches/Switch1/Ports/Port1/StaticMACs/1" }, ) self.static_mac_col = ethernet_switch_static_mac.\ EthernetSwitchStaticMACCollection( self.conn, "/redfish/v1/EthernetSwitches/Switch1/Ports/Port1/StaticMACs", redfish_version="1.1.0", )
def setUp(self): super(EthernetSwitchACLRuleCollectionTestCase, self).setUp() self.conn = mock.Mock() with open( "rsd_lib/tests/unit/json_samples/v2_1/" "ethernet_switch_acl_rule_collection.json", "r", ) as f: self.conn.get.return_value.json.return_value = json.loads(f.read()) self.conn.post.return_value = request_fakes.fake_request_post( None, headers={ "Location": "https://localhost:8443/redfish/v1/" "EthernetSwitches/Switch1/ACLs/ACL1/" "Rules/Rule1" }, ) self.acl_rule_col = ethernet_switch_acl_rule.\ EthernetSwitchACLRuleCollection( self.conn, "/redfish/v1/EthernetSwitches/Switch1/ACLs/ACL1/Rules", redfish_version="1.0.2", )
def setUp(self): super(NodeCollectionTestCase, self).setUp() self.conn = mock.Mock() with open('rsd_lib/tests/unit/json_samples/v2_1/node_collection.json', 'r') as f: self.conn.get.return_value = request_fakes.fake_request_get( json.loads(f.read())) self.conn.post.return_value = request_fakes.fake_request_post( None, headers={"Location": "https://localhost:8443/" "redfish/v1/Nodes/1"}) self.node_col = node.NodeCollection( self.conn, '/redfish/v1/Nodes', redfish_version='1.0.2')
def setUp(self): super(ZoneCollectionTestCase, self).setUp() self.conn = mock.Mock() with open( 'rsd_lib/tests/unit/json_samples/v2_3/' 'zone_collection.json', 'r') as f: self.conn.get.return_value.json.return_value = json.loads(f.read()) self.conn.post.return_value = request_fakes.fake_request_post( None, headers={ "Location": "https://localhost:8443/redfish/v1/" "Fabrics/NVMeoE/Zones/2" }) self.zone_col = zone.ZoneCollection(self.conn, '/redfish/v1/Fabrics/NVMeoE/Zones', redfish_version='1.0.2')
def setUp(self): super(TriggerCollectionTestCase, self).setUp() self.conn = mock.Mock() with open( 'rsd_lib/tests/unit/json_samples/v2_2/' 'trigger_collection.json', 'r') as f: self.conn.get.return_value.json.return_value = json.loads(f.read()) self.conn.post.return_value = request_fakes.fake_request_post( None, headers={ "Location": "https://localhost:8443/redfish/v1/" "TelemetryService/Triggers/2" }) self.trigger_col = trigger.TriggerCollection( self.conn, '/redfish/v1/TelemetryService/Triggers', redfish_version='1.1.0')
def setUp(self): super(VLanNetworkInterfaceCollectionTestCase, self).setUp() self.conn = mock.Mock() with open( "rsd_lib/tests/unit/json_samples/v2_1/" "ethernet_switch_port_vlan_collection.json", "r", ) as f: self.conn.get.return_value = request_fakes.fake_request_get( json.loads(f.read())) self.conn.post.return_value = request_fakes.fake_request_post( None, headers={ "Location": "https://localhost:8443/redfish/v1/" "EthernetSwitches/Switch1/" "Ports/Port1/VLANs/VLAN1" }, ) self.vlan_col = vlan_network_interface.VLanNetworkInterfaceCollection( self.conn, "/redfish/v1/EthernetSwitches/Switch1/Ports/Port1/VLANs", redfish_version="1.1.0", )