forked from mozilla/mozilla_ci_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Armen Zambrano G
committed
Jul 1, 2016
1 parent
01a7426
commit 120e27f
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import pytest | ||
from mock import patch | ||
|
||
from mozci.utils.misc import _all_urls_reachable | ||
|
||
# XXX: We could also patch requests.head to speed things up | ||
@pytest.mark.parametrize("urls,result", [ | ||
(["https://github.com/mozilla/mozilla_ci_tools", "https://github.com/mozilla/404"], False), | ||
(["https://github.com/mozilla/mozilla_ci_tools"], True), | ||
]) | ||
@patch('mozci.utils.misc.get_credentials') | ||
def test_not_all_urls_are_reachable(get_credentials, urls, result): | ||
get_credentials.return_value = ('', '') | ||
assert _all_urls_reachable(urls=urls) == result |