def test_create_map(self): portal = Portal('http://localhost:8090/iportal', 'admin', 'Supermap123') portal._portal = mock.MagicMock() maps_service = mock.MagicMock() portal._portal.maps_service = mock.MagicMock(return_value=maps_service) res = MethodResult() res.newResourceID = 'map_id'; maps_service.post_maps = mock.MagicMock(return_value=res) result = portal.create_map([Layer()], 3857, 'map', (0, 0), (-180, -90, 180, 90)) self.assertEqual(result, 'map_id')
def test_create_map(self): online = self.online online._online = mock.MagicMock() maps_service = mock.MagicMock() online._online.maps_service = mock.MagicMock(return_value=maps_service) res = MethodResult() res.newResourceID = 'map_id' maps_service.post_maps = mock.MagicMock(return_value=res) result = online.create_map([Layer()], 3857, 'map', (0, 0), (-180, -90, 180, 90)) self.assertEqual(result, 'map_id')