def interconnect_types(self):
        """
        Gets the InterconnectTypes API client.

        Returns:
            InterconnectTypes:
        """
        return InterconnectTypes(self.__connection)
Exemplo n.º 2
0
    def interconnect_types(self):
        """
        Gets the InterconnectTypes API client.

        Returns:
            InterconnectTypes:
        """
        if not self.__interconnect_types:
            self.__interconnect_types = InterconnectTypes(self.__connection)
        return self.__interconnect_types
Exemplo n.º 3
0
class InterconnectTypesTest(unittest.TestCase):
    def setUp(self):
        self.host = '127.0.0.1'
        self.connection = connection(self.host)
        self._interconnect_types = InterconnectTypes(self.connection)

    @mock.patch.object(ResourceClient, 'get')
    def test_get_called_once(self, mock_get):
        self._interconnect_types.get('c6f4e705-2bb5-430a-b7a1-a35b2f7aa9b9')

        mock_get.assert_called_once_with(
            'c6f4e705-2bb5-430a-b7a1-a35b2f7aa9b9')

    @mock.patch.object(ResourceClient, 'get_all')
    def test_get_all_called_once(self, mock_get_all):
        filter = 'name=TestName'
        sort = 'name:ascending'

        self._interconnect_types.get_all(2, 500, filter, sort)

        mock_get_all.assert_called_once_with(2, 500, filter=filter, sort=sort)

    @mock.patch.object(ResourceClient, 'get_by')
    def test_get_by_called_once(self, mock_get_by):
        self._interconnect_types.get_by('name', 'HP VC Flex-10 Enet Module')

        mock_get_by.assert_called_once_with('name',
                                            'HP VC Flex-10 Enet Module')
class InterconnectTypesTest(unittest.TestCase):

    def setUp(self):
        self.host = '127.0.0.1'
        self.connection = connection(self.host)
        self._interconnect_types = InterconnectTypes(self.connection)

    @mock.patch.object(ResourceClient, 'get')
    def test_get_called_once(self, mock_get):
        self._interconnect_types.get('c6f4e705-2bb5-430a-b7a1-a35b2f7aa9b9')

        mock_get.assert_called_once_with(
            'c6f4e705-2bb5-430a-b7a1-a35b2f7aa9b9')

    @mock.patch.object(ResourceClient, 'get_all')
    def test_get_all_called_once(self, mock_get_all):
        filter = 'name=TestName'
        sort = 'name:ascending'

        self._interconnect_types.get_all(2, 500, filter, sort)

        mock_get_all.assert_called_once_with(2, 500, filter=filter, sort=sort)

    @mock.patch.object(ResourceClient, 'get_by')
    def test_get_by_called_once(self, mock_get_by):
        self._interconnect_types.get_by('name', 'HP VC Flex-10 Enet Module')

        mock_get_by.assert_called_once_with(
            'name', 'HP VC Flex-10 Enet Module')
class InterconnectTypesTest(unittest.TestCase):

    def setUp(self):
        self.host = '127.0.0.1'
        self.connection = connection(self.host)
        self._interconnect_types = InterconnectTypes(self.connection)

    @mock.patch.object(ResourceHelper, 'do_requests_to_getall')
    def test_get_all_called_once(self, mock_do_get):
        filter = 'name=TestName'
        sort = 'name:ascending'

        self._interconnect_types.get_all(2, 500, filter=filter, sort=sort)

        mock_do_get.assert_called_once_with('/rest/interconnect-types?start=2&count=500&filter=name%3DTestName&sort=name%3Aascending', 500)

    @mock.patch.object(Resource, 'get_by')
    def test_get_by_called_once(self, mock_get_by):
        self._interconnect_types.get_by_name('HP VC Flex-10 Enet Module')

        mock_get_by.assert_called_once_with(
            'name', 'HP VC Flex-10 Enet Module')
class InterconnectTypesTest(unittest.TestCase):

    def setUp(self):
        self.host = '127.0.0.1'
        self.connection = connection(self.host)
        self._interconnect_types = InterconnectTypes(self.connection)

    @mock.patch.object(ResourceHelper, 'do_requests_to_getall')
    def test_get_all_called_once(self, mock_do_get):
        filter = 'name=TestName'
        sort = 'name:ascending'

        self._interconnect_types.get_all(2, 500, filter=filter, sort=sort)

        mock_do_get.assert_called_once_with('/rest/interconnect-types?start=2&count=500&filter=name%3DTestName&sort=name%3Aascending', 500)

    @mock.patch.object(Resource, 'get_by')
    def test_get_by_called_once(self, mock_get_by):
        self._interconnect_types.get_by_name('HP VC Flex-10 Enet Module')

        mock_get_by.assert_called_once_with(
            'name', 'HP VC Flex-10 Enet Module')
Exemplo n.º 7
0
 def setUp(self):
     self.host = '127.0.0.1'
     self.connection = connection(self.host)
     self._interconnect_types = InterconnectTypes(self.connection)
Exemplo n.º 8
0
 def interconnect_types(self):
     if not self.__interconnect_types:
         self.__interconnect_types = InterconnectTypes(self.__connection)
     return self.__interconnect_types
 def setUp(self):
     self.host = '127.0.0.1'
     self.connection = connection(self.host)
     self._interconnect_types = InterconnectTypes(self.connection)