Skip to content

Commit

Permalink
Test coverage for misc.py module
Browse files Browse the repository at this point in the history
  • 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.
14 changes: 14 additions & 0 deletions test/test_misc.py
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

0 comments on commit 120e27f

Please sign in to comment.