Example #1
0
    def get_interfaces(self, management_address):
        """Lists interfaces attached to the resource.

        This lists the interfaces attached to the resource from the POV
        of the resource iteslf.

        :returns: A list of interfaces
        """
        return astara_client.get_interfaces(management_address, self.mgt_port)
Example #2
0
    def get_interfaces(self, management_address):
        """Lists interfaces attached to the resource.

        This lists the interfaces attached to the resource from the POV
        of the resource iteslf.

        :returns: A list of interfaces
        """
        return astara_client.get_interfaces(management_address,
                                            self.mgt_port)
    def test_get_interfaces(self):
        self.mock_get.return_value.status_code = 200
        self.mock_get.return_value.json.return_value = {
            'interfaces': 'the_interfaces'
        }

        self.assertEqual(astara_client.get_interfaces('fe80::2', 5000),
                         'the_interfaces')
        self.mock_get.assert_called_once_with(
            'http://[fe80::2]:5000/v1/system/interfaces',
            timeout=30
        )
Example #4
0
    def test_get_interfaces(self):
        self.mock_get.return_value.status_code = 200
        self.mock_get.return_value.json.return_value = {
            'interfaces': 'the_interfaces'
        }

        self.assertEqual(astara_client.get_interfaces('fe80::2', 5000),
                         'the_interfaces')
        self.mock_get.assert_called_once_with(
            'http://[fe80::2]:5000/v1/system/interfaces',
            timeout=30
        )