def test_download_configdrive_to_file(self, get_mock, write_mock): url = 'http://swift/configdrive' get_mock.return_value.content = 'data' standby._download_configdrive_to_file(url, 'filename') get_mock.assert_called_once_with(url) write_mock.assert_called_once_with('data', 'filename')