def testGetPprojectTransfer403Exception(self, mockRemoteStore): transfer_id = 'abvcca-123' get_project_transfer = mockRemoteStore.return_value.data_service.get_project_transfer get_project_transfer.side_effect = DataServiceError( response=Mock(status_code=403), url_suffix="", request_data=Mock()) ddsutil = DDSUtil(self.user) with self.assertRaises(DDSNotRecipientException): ddsutil.get_project_transfer(transfer_id)
def testGetProjectTransfer(self, mockRemoteStore): mock_requests_response = MagicMock() transfer_id = 'abvcca-123' get_project_transfer = mockRemoteStore.return_value.data_service.get_project_transfer get_project_transfer.return_value = mock_requests_response ddsutil = DDSUtil(self.user) project_transfer_response = ddsutil.get_project_transfer(transfer_id) self.assertTrue(get_project_transfer.called_with(transfer_id)) self.assertEqual(project_transfer_response, mock_requests_response)