# test code for the win_get_url module # (c) 2014, Chris Church # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see . - name: remove test file if it exists raw: PowerShell -Command {Remove-Item "C:\Users\Administrator\win_get_url.jpg" -Force} - name: test win_get_url module win_get_url: url=http://placehold.it/10x10.jpg dest='C:\Users\Administrator\win_get_url.jpg' register: win_get_url_result - name: check win_get_url result assert: that: - "not win_get_url_result|failed" - "win_get_url_result|changed" # FIXME: # - Test invalid url # - Test invalid dest, when dest is directory # - Test idempotence when downloading same url/dest (not yet implemented)