Should I test every single method in Integration Test?

  integration-testing, python, unit-testing

I often find methods that combine 2 responsibilities into 1 like the CreateOrUpdate method, I was wondering, should I test every method in Integration Test? isn’t it when we test this method is already testing everything inside it? we can just create 2 test cases, 1 for update and 1 for create?

Here is my source code :

def distribute_transaction(self,depth_purchase_request_id:int,bulk_reference_lead_id:int,customer_requested:Customer,r123_depth_purchase:DepthPurchaseRequestViewModel):
            depth_bulk_purchases =self._depth_bulk_purchase_repo.get_all_by_depth_purchase_id(depth_purchase_request_id)
            
            for depth_bulk_purchase in depth_bulk_purchases:    
                if depth_bulk_purchase.customer_id == customer_requested.id:
                    continue
                lead_depth_bulk_purchase_exists = self._lead_depth_bulk_purchase_repo.get_by_depth_bulk_purchase(depth_bulk_purchase.id)
                
                if not lead_depth_bulk_purchase_exists:
                    self.create_lead_and_transaction(depth_bulk_purchase,bulk_reference_lead_id,LeadStageConstants.PACKAGE_ACTIVE,r123_depth_purchase)
                else:
                    self.update_lead_and_transaction(depth_bulk_purchase,LeadStageConstants.PACKAGE_ACTIVE,r123_depth_purchase,lead_depth_bulk_purchase_exists)
    
def create_lead_and_transaction(...):
    ....
def update_lead_and_transaction(...):
    ....   



  

Source: Python Questions

LEAVE A COMMENT