def test_hash_csv_with_valid_input(self): self.config.COLUMNS_TO_HASH = ['SSN'] mock_keys = { ApiKeys.SALT_KEYS: [{ "value": "test-salt-key" }], ApiKeys.ENCRYPTION_KEY: "_hSmVyMTLi-Qo_rmISp8jrH5Aob7frHp1X-28sxQZAU=" } file_data = HashService.read_csv(self.config.FILES[0], self.config) HashService.hash_csv(self.config.FILES[0], file_data, self.config, mock_keys)
def test_write_hashed_csv_with_valid_input(self): file_data = HashService.read_csv(self.config.FILES[0], self.config) mock_keys = { ApiKeys.SALT_KEYS: [{ "value": "test-salt-key" }], ApiKeys.ENCRYPTION_KEY: "_hSmVyMTLi-Qo_rmISp8jrH5Aob7frHp1X-28sxQZAU=" } HashService.hash_csv(self.config.FILES[0], file_data, self.config, mock_keys) HashService.write_hashed_csv(self.config.FILES[0], file_data, self.config) assert os.path.exists(self.config.HASHED_FILES[0]) os.remove(self.config.HASHED_FILES[0])