def interconnect_types(self): """ Gets the InterconnectTypes API client. Returns: InterconnectTypes: """ return InterconnectTypes(self.__connection)
class InterconnectTypesTest(unittest.TestCase): def setUp(self): self.host = '127.0.0.1' self.connection = connection(self.host, 800) 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')
def setUp(self): self.host = '127.0.0.1' self.connection = connection(self.host, 800) self._interconnect_types = InterconnectTypes(self.connection)