def METHOD_NAME(self, mock_log, mock_mtemp, mock_remove,
                                   mock_isfile, mock_rename, mock_fsync):
    opener_mock = mock.mock_open()
    mock_isfile.return_value = True
    mock_mtemp.return_value = ("im_ignored",
                               "/var/run/random_temp.txt")
    with mock.patch('builtins.open', opener_mock, create=True) as m:
        m.return_value.write.side_effect = OSError((errno.EPERM),
                                                   'Not Allowed')
        m.return_value.closed = False
        # Assert is swallowed
        util.atomicFileWrite("/var/run/test.txt", "var/run",
                             "blah blah")
        expectedMsg = "FAILED to atomic write to /var/run/test.txt"
        mock_log.assert_called_with(expectedMsg)
        mock_remove.assert_called_with("/var/run/random_temp.txt")
        self.assertEqual(opener_mock.return_value.close.call_count, 1)