CJohnston079 / obfuscator

0 stars 0 forks source link

Replace mocked util functions in `test_obfuscator_returns_expected_value` with function calls #20

Closed CJohnston079 closed 4 months ago

CJohnston079 commented 4 months ago

Issue

The mocked util functions in test_obfuscator_returns_expected_value serve to test obfuscator is returning the correct value without being dependent on the implementation of the util functions themselves. However, the mocks rob test_obfuscator_returns_expected_value of diagnostic power to catch potential integration issues with the util functions.

get_file_type = mocker.patch("src.obfuscator.get_file_type")
get_data = mocker.patch("src.obfuscator.get_data")
obfuscate_fields = mocker.patch("src.obfuscator.obfuscate_fields")
format_data = mocker.patch("src.obfuscator.format_data")

get_file_type.return_value = "xml"
get_data.return_value = original_data
obfuscate_fields.return_value = obfuscated_data
format_data.return_value = expected_return

Proposed resolution

The mocked functions should be removed from test_obfuscator_returns_expected_value to allow it to act as a general smoke test for uncaught errors within the util functions.

CJohnston079 commented 4 months ago

Resolved in bfd4b24d2c207311acff627c2950d0c5ac04729d.