Пример #1
0
 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(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",
     )