Ejemplo n.º 1
0
 def test_add_candidate(self, mock_boto3_resource):
     manager = DynamoDBManager()
     candidate_full_name = "Person Personson"
     candidate_email = "some email"
     candidate_link = "some link"
     manager.add_candidate(candidate_full_name, candidate_email,
                           candidate_link)
     manager.candidates_table.put_item.assert_called_with(
         Item={
             "full_name": candidate_full_name,
             "candidate_email": candidate_email,
             "candidate_page_link": candidate_link
         })
 def add_candidates(cls, candidates_list):
     """
     This method adds specified candidates to the database.
     """
     for candidate in candidates_list:
         database = DynamoDBManager()
         response = database.add_candidate(candidate["candidate_full_name"],
                                           candidate["candidate_email"],
                                           candidate["candidate_page_link"])
     return response