Skip to content
Prev Previous commit
Next Next commit
install pytest-mock
  • Loading branch information
GuilhermeePires committed Apr 24, 2022
commit d87a74a0149c809e362dbde6a6cafde5e35977f3
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ python:
install:
- pip install -q -r requirements-dev.txt
script:
-flake8
-flake8
-pytest libpythonpro
10 changes: 5 additions & 5 deletions libpythonpro/tests/test_spam/test_github_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
@pytest.fixture
def avatar_url(mocker):
resp_mock = Mock()
url = 'https://avatars3.githubusercontent.com/u/402714?v=4'
url = 'https://avatars.githubusercontent.com/u/102936883?v=4'
resp_mock.json.return_value = {
'login': 'renzo', 'id': 402714,
'login': 'GuilhermeePires', 'id': 102936883,
'avatar_url': url,
}
get_mock = mocker.patch('libpythonpro.github_api.requests.get')
Expand All @@ -19,10 +19,10 @@ def avatar_url(mocker):


def test_buscar_avatar(avatar_url):
url = github_api.buscar_avatar('renzo')
url = github_api.buscar_avatar('GuilhermeePires')
assert avatar_url == url


def test_buscar_avatar_integracao():
url = github_api.buscar_avatar('renzon')
assert 'https://avatars3.githubusercontent.com/u/3457115?v=4' == url
url = github_api.buscar_avatar('GuilhermeePires')
assert 'https://avatars.githubusercontent.com/u/102936883?v=4' == url