def test_fail_filemod(mocker, data_str, expected): """ Given: - A process event data containing invalid filemod field When: - formatting the data to correct format Then: - validates when field in the response are missing, the error will show and the value be skipped. """ from CarbonBlackResponseV2 import filemod_complete demisto_mocker = mocker.patch.object(demisto, 'debug') filemod_complete(data_str) assert demisto_mocker.call_args[0][0] == expected
def test_filemod(data_str, expected): """ Given: - A process event data containing filemod field When: - formatting the data to correct format Then: - validating the new filemod field contains json with correctly mapped data """ from CarbonBlackResponseV2 import filemod_complete res = filemod_complete(data_str).format() assert res == expected