From 1beaa1f1d655b8c55f69742f9d4407777e761fcf Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Thu, 11 Aug 2022 14:33:59 -0300 Subject: [PATCH 01/19] =?UTF-8?q?Adicionada=20informa=C3=A7=C3=A3o=20sobre?= =?UTF-8?q?=20contribui=C3=A7=C3=A3o=20a=20projetos=20de=20c=C3=B3digo=20a?= =?UTF-8?q?bertos.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 676c14d7f..d6a5adaff 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,5 @@ Tópicos a serem abordados: 3. Pip 4. Mock 5. Pipenv - \ No newline at end of file + +Revisando aula sobre Fork. \ No newline at end of file From 2b375615ede88a3ddd0e07c831fa8e6cfdf2a61c Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Thu, 11 Aug 2022 15:02:00 -0300 Subject: [PATCH 02/19] Inserido a melhoria para o curos no Readme Carlos. close #724 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d6a5adaff..aa4572619 100644 --- a/README.md +++ b/README.md @@ -33,4 +33,6 @@ Tópicos a serem abordados: 4. Mock 5. Pipenv -Revisando aula sobre Fork. \ No newline at end of file +Revisando aula sobre Fork. + +Link do Curso [Python pro](https://pythonpro.com.br/) \ No newline at end of file From 1381d9919327746f7fd3711f5c037af3a5bc1c21 Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Thu, 18 Aug 2022 19:00:01 -0300 Subject: [PATCH 03/19] Suportada python 3 Carlinhos --- README.md | 2 +- libpythonpro/__init__.py | 1 - libpythonpro/github_api.py | 13 ----- libpythonpro/spam/__init__.py | 0 libpythonpro/spam/db.py | 31 ------------ libpythonpro/spam/enviador_de_email.py | 9 ---- libpythonpro/spam/main.py | 13 ----- libpythonpro/spam/modelos.py | 5 -- libpythonpro/tests/__init__.py | 0 libpythonpro/tests/test_exemplo.py | 2 - libpythonpro/tests/test_spam/__init__.py | 0 libpythonpro/tests/test_spam/conftest.py | 20 -------- .../tests/test_spam/test_enviador_de_email.py | 38 -------------- .../test_envio_para_base_de_usuarios.py | 49 ------------------- .../tests/test_spam/test_github_api.py | 28 ----------- libpythonpro/tests/test_spam/test_usuarios.py | 17 ------- 16 files changed, 1 insertion(+), 227 deletions(-) delete mode 100644 libpythonpro/__init__.py delete mode 100644 libpythonpro/github_api.py delete mode 100644 libpythonpro/spam/__init__.py delete mode 100644 libpythonpro/spam/db.py delete mode 100644 libpythonpro/spam/enviador_de_email.py delete mode 100644 libpythonpro/spam/main.py delete mode 100644 libpythonpro/spam/modelos.py delete mode 100644 libpythonpro/tests/__init__.py delete mode 100644 libpythonpro/tests/test_exemplo.py delete mode 100644 libpythonpro/tests/test_spam/__init__.py delete mode 100644 libpythonpro/tests/test_spam/conftest.py delete mode 100644 libpythonpro/tests/test_spam/test_enviador_de_email.py delete mode 100644 libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py delete mode 100644 libpythonpro/tests/test_spam/test_github_api.py delete mode 100644 libpythonpro/tests/test_spam/test_usuarios.py diff --git a/README.md b/README.md index aa4572619..4458e74f9 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Link para o curso [Python Pro](https://www.python.pro.br/) [![Python 3](https://pyup.io/repos/github/pythonprobr/libpythonpro/python-3-shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) [![codecov](https://codecov.io/gh/pythonprobr/libpythonpro/branch/master/graph/badge.svg)](https://codecov.io/gh/pythonprobr/libpythonpro) -Suportada versão 3 de Python +Suportada versão 3 de Python Carlinhos Para instalar: diff --git a/libpythonpro/__init__.py b/libpythonpro/__init__.py deleted file mode 100644 index b650ceb08..000000000 --- a/libpythonpro/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = '0.2' diff --git a/libpythonpro/github_api.py b/libpythonpro/github_api.py deleted file mode 100644 index 8b0fbafb9..000000000 --- a/libpythonpro/github_api.py +++ /dev/null @@ -1,13 +0,0 @@ -import requests - - -def buscar_avatar(usuario): - """ - Busca o avatar de um usuário no Github - - :param usuario: str com o nome de usuário no github - :return: str com o link do avatar - """ - url = f'https://api.github.com/users/{usuario}' - resp = requests.get(url) - return resp.json()['avatar_url'] diff --git a/libpythonpro/spam/__init__.py b/libpythonpro/spam/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/libpythonpro/spam/db.py b/libpythonpro/spam/db.py deleted file mode 100644 index ce90ca60b..000000000 --- a/libpythonpro/spam/db.py +++ /dev/null @@ -1,31 +0,0 @@ -from time import sleep - - -class Sessao: - contador = 0 - usuarios = [] - - def salvar(self, usuario): - Sessao.contador += 1 - usuario.id = Sessao.contador - self.usuarios.append(usuario) - - def listar(self): - return self.usuarios - - def roll_back(self): - self.usuarios.clear() - - def fechar(self): - pass - - -class Conexao: - def __init__(self): - sleep(1) - - def gerar_sessao(self): - return Sessao() - - def fechar(self): - pass diff --git a/libpythonpro/spam/enviador_de_email.py b/libpythonpro/spam/enviador_de_email.py deleted file mode 100644 index fa0952223..000000000 --- a/libpythonpro/spam/enviador_de_email.py +++ /dev/null @@ -1,9 +0,0 @@ -class Enviador: - def enviar(self, remetente, destinatario, assunto, corpo): - if '@' not in remetente: - raise EmailInvalido(f'Email de remetente inválido: {remetente}') - return remetente - - -class EmailInvalido(Exception): - pass diff --git a/libpythonpro/spam/main.py b/libpythonpro/spam/main.py deleted file mode 100644 index f81821ae4..000000000 --- a/libpythonpro/spam/main.py +++ /dev/null @@ -1,13 +0,0 @@ -class EnviadorDeSpam: - def __init__(self, sessao, enviador): - self.sessao = sessao - self.enviador = enviador - - def enviar_emails(self, remetente, assunto, corpo): - for usuario in self.sessao.listar(): - self.enviador.enviar( - remetente, - usuario.email, - assunto, - corpo - ) diff --git a/libpythonpro/spam/modelos.py b/libpythonpro/spam/modelos.py deleted file mode 100644 index 093b35a2a..000000000 --- a/libpythonpro/spam/modelos.py +++ /dev/null @@ -1,5 +0,0 @@ -class Usuario: - def __init__(self, nome, email): - self.email = email - self.nome = nome - self.id = None diff --git a/libpythonpro/tests/__init__.py b/libpythonpro/tests/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/libpythonpro/tests/test_exemplo.py b/libpythonpro/tests/test_exemplo.py deleted file mode 100644 index 78cd50236..000000000 --- a/libpythonpro/tests/test_exemplo.py +++ /dev/null @@ -1,2 +0,0 @@ -def test_int(): - assert 1 == 1 diff --git a/libpythonpro/tests/test_spam/__init__.py b/libpythonpro/tests/test_spam/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/libpythonpro/tests/test_spam/conftest.py b/libpythonpro/tests/test_spam/conftest.py deleted file mode 100644 index a16f3970a..000000000 --- a/libpythonpro/tests/test_spam/conftest.py +++ /dev/null @@ -1,20 +0,0 @@ -import pytest - -from libpythonpro.spam.db import Conexao - - -@pytest.fixture(scope='session') -def conexao(): - # Setup - conexao_obj = Conexao() - yield conexao_obj - # Tear Down - conexao_obj.fechar() - - -@pytest.fixture -def sessao(conexao): - sessao_obj = conexao.gerar_sessao() - yield sessao_obj - sessao_obj.roll_back() - sessao_obj.fechar() diff --git a/libpythonpro/tests/test_spam/test_enviador_de_email.py b/libpythonpro/tests/test_spam/test_enviador_de_email.py deleted file mode 100644 index c72a0bbe9..000000000 --- a/libpythonpro/tests/test_spam/test_enviador_de_email.py +++ /dev/null @@ -1,38 +0,0 @@ -import pytest - -from libpythonpro.spam.enviador_de_email import EmailInvalido, Enviador - - -def test_criar_enviador_de_email(): - enviador = Enviador() - assert enviador is not None - - -@pytest.mark.parametrize( - 'remetente', - ['foo@bar.com.br', 'renzo@python.pro.br'] -) -def test_remetente(remetente): - enviador = Enviador() - resultado = enviador.enviar( - remetente, - 'luciano@python.pro.br', - 'Cursos Python Pro', - 'Primeira turma Guido Von Rossum aberta.' - ) - assert remetente in resultado - - -@pytest.mark.parametrize( - 'remetente', - ['', 'renzo'] -) -def test_remetente_invalido(remetente): - enviador = Enviador() - with pytest.raises(EmailInvalido): - enviador.enviar( - remetente, - 'luciano@python.pro.br', - 'Cursos Python Pro', - 'Primeira turma Guido Von Rossum aberta.' - ) diff --git a/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py b/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py deleted file mode 100644 index d2db43893..000000000 --- a/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py +++ /dev/null @@ -1,49 +0,0 @@ -from unittest.mock import Mock - -import pytest - -from libpythonpro.spam.main import EnviadorDeSpam -from libpythonpro.spam.modelos import Usuario - - -@pytest.mark.parametrize( - 'usuarios', - [ - [ - Usuario(nome='Renzo', email='renzo@python.pro.br'), - Usuario(nome='Luciano', email='renzo@python.pro.br') - ], - [ - Usuario(nome='Renzo', email='renzo@python.pro.br') - ] - ] -) -def test_qde_de_spam(sessao, usuarios): - for usuario in usuarios: - sessao.salvar(usuario) - enviador = Mock() - enviador_de_spam = EnviadorDeSpam(sessao, enviador) - enviador_de_spam.enviar_emails( - 'renzo@python.pro.br', - 'Curso Python Pro', - 'Confira os módulos fantásticos' - ) - assert len(usuarios) == enviador.enviar.call_count - - -def test_parametros_de_spam(sessao): - usuario = Usuario(nome='Renzo', email='renzo@python.pro.br') - sessao.salvar(usuario) - enviador = Mock() - enviador_de_spam = EnviadorDeSpam(sessao, enviador) - enviador_de_spam.enviar_emails( - 'luciano@python.pro.br', - 'Curso Python Pro', - 'Confira os módulos fantásticos' - ) - enviador.enviar.assert_called_once_with( - 'luciano@python.pro.br', - 'renzo@python.pro.br', - 'Curso Python Pro', - 'Confira os módulos fantásticos' - ) diff --git a/libpythonpro/tests/test_spam/test_github_api.py b/libpythonpro/tests/test_spam/test_github_api.py deleted file mode 100644 index 21ce9c5d0..000000000 --- a/libpythonpro/tests/test_spam/test_github_api.py +++ /dev/null @@ -1,28 +0,0 @@ -from unittest.mock import Mock - -import pytest - -from libpythonpro import github_api - - -@pytest.fixture -def avatar_url(mocker): - resp_mock = Mock() - url = 'https://avatars3.githubusercontent.com/u/402714?v=4' - resp_mock.json.return_value = { - 'login': 'renzo', 'id': 402714, - 'avatar_url': url, - } - get_mock = mocker.patch('libpythonpro.github_api.requests.get') - get_mock.return_value = resp_mock - return url - - -def test_buscar_avatar(avatar_url): - url = github_api.buscar_avatar('renzo') - 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 diff --git a/libpythonpro/tests/test_spam/test_usuarios.py b/libpythonpro/tests/test_spam/test_usuarios.py deleted file mode 100644 index 09b523445..000000000 --- a/libpythonpro/tests/test_spam/test_usuarios.py +++ /dev/null @@ -1,17 +0,0 @@ -from libpythonpro.spam.modelos import Usuario - - -def test_salvar_usuario(sessao): - usuario = Usuario(nome='Renzo', email='renzo@python.pro.br') - sessao.salvar(usuario) - assert isinstance(usuario.id, int) - - -def test_listar_usuarios(sessao): - usuarios = [ - Usuario(nome='Renzo', email='renzo@python.pro.br'), - Usuario(nome='Luciano', email='renzo@python.pro.br') - ] - for usuario in usuarios: - sessao.salvar(usuario) - assert usuarios == sessao.listar() From b424cd73b2434a2c68af6566a0b00f51e52fccb2 Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Mon, 22 Aug 2022 16:21:35 -0300 Subject: [PATCH 04/19] =?UTF-8?q?Adicionada=20flake8=20como=20depend=C3=AA?= =?UTF-8?q?ncia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #12 --- Libpythonpro/__init__.py | 0 Libpythonpro/github_api.py | 16 ++++++++++++++++ README.md | 7 ++++--- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 Libpythonpro/__init__.py create mode 100644 Libpythonpro/github_api.py diff --git a/Libpythonpro/__init__.py b/Libpythonpro/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Libpythonpro/github_api.py b/Libpythonpro/github_api.py new file mode 100644 index 000000000..abc64ed4d --- /dev/null +++ b/Libpythonpro/github_api.py @@ -0,0 +1,16 @@ +import requests + + +def buscar_avatar(usuario): + """ + Busca o avatar de um usuário no Github + :Param usuário: str com o nome usuário no github + :return: str com o link do avatar + """ + url = f'https://api.github.com/users/{usuario}' + resp = requests.get(url) + return resp.json()['avatar_url'] + + +if __name__ == '__main__': + print(buscar_avatar('Carloshbfreire')) diff --git a/README.md b/README.md index 4458e74f9..b7a10cea4 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,15 @@ Suportada versão 3 de Python Carlinhos Para instalar: ```console -pip install pipenv -pipenv install --dev +python3 -m venv .venv +source .venv/bin/activete +pip install -r requirements-dev.txt ``` Para conferir qualidade de código: ```console -pipenv run flake8 +flake8 ``` Tópicos a serem abordados: From e4d778c4c1565a0f7157ca196e5586809123f3d0 Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Mon, 29 Aug 2022 15:57:54 -0300 Subject: [PATCH 05/19] Criado setup.py, para release 0.1 close #18 --- .travis.yml | 12 ++++-------- Libpythonpro/__init__.py | 1 + README.md | 3 ++- setup.py | 6 +++--- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6694375b7..09bc50a74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,7 @@ language: python python: - - 3.7 -install: - - pip install -q pipenv codecov - - pipenv sync --dev -script: + - 3.10 + + install: + - pip install -q -r requirements-dev.txt - flake8 - - pytest libpythonpro --cov=libpythonpro -after_success: - - codecov \ No newline at end of file diff --git a/Libpythonpro/__init__.py b/Libpythonpro/__init__.py index e69de29bb..5e3048b21 100644 --- a/Libpythonpro/__init__.py +++ b/Libpythonpro/__init__.py @@ -0,0 +1 @@ +__version__ = '0.1' \ No newline at end of file diff --git a/README.md b/README.md index b7a10cea4..9971f75e1 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,14 @@ Link para o curso [Python Pro](https://www.python.pro.br/) [![Python 3](https://pyup.io/repos/github/pythonprobr/libpythonpro/python-3-shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) [![codecov](https://codecov.io/gh/pythonprobr/libpythonpro/branch/master/graph/badge.svg)](https://codecov.io/gh/pythonprobr/libpythonpro) + Suportada versão 3 de Python Carlinhos Para instalar: ```console python3 -m venv .venv -source .venv/bin/activete +source .venv/bin/activate pip install -r requirements-dev.txt ``` diff --git a/setup.py b/setup.py index 1fea97a65..895662a98 100644 --- a/setup.py +++ b/setup.py @@ -101,7 +101,7 @@ def find_package_data( return out -PACKAGE = "libpythonpro" +PACKAGE = "Libpythonpro" NAME = PACKAGE DESCRIPTION = "Módulo para exemplificar construção de projetos Python no curso PyTools" AUTHOR = "Renzo Nuccitelli" @@ -117,7 +117,7 @@ def find_package_data( long_description_content_type='text/markdown', author=AUTHOR, author_email=AUTHOR_EMAIL, - license="GNU AFFERO GENERAL PUBLIC LICENSE", + license=read('LICENSE'), url=URL, packages=find_packages(exclude=["tests.*", "tests"]), package_data=find_package_data(PACKAGE, only_in_packages=False), @@ -128,7 +128,7 @@ def find_package_data( "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.10", "Framework :: Pytest", ], install_requires=[ From 3a4e36bccde16c1ed6bb1409ae002e42f0cff49d Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Thu, 8 Sep 2022 15:51:27 -0300 Subject: [PATCH 06/19] Inserido teste com pytest close #21 --- .travis.yml | 1 + Libpythonpro/__init__.py | 2 +- Libpythonpro/tests/__init__.py | 0 Libpythonpro/tests/test_exemplo.py | 2 ++ setup.py | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 Libpythonpro/tests/__init__.py create mode 100644 Libpythonpro/tests/test_exemplo.py diff --git a/.travis.yml b/.travis.yml index 09bc50a74..e9a9a9bef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,3 +5,4 @@ python: install: - pip install -q -r requirements-dev.txt - flake8 + - pytest Libpythonpro \ No newline at end of file diff --git a/Libpythonpro/__init__.py b/Libpythonpro/__init__.py index 5e3048b21..edcfd0dd7 100644 --- a/Libpythonpro/__init__.py +++ b/Libpythonpro/__init__.py @@ -1 +1 @@ -__version__ = '0.1' \ No newline at end of file +__version__ = '0.2' \ No newline at end of file diff --git a/Libpythonpro/tests/__init__.py b/Libpythonpro/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Libpythonpro/tests/test_exemplo.py b/Libpythonpro/tests/test_exemplo.py new file mode 100644 index 000000000..41c6a2761 --- /dev/null +++ b/Libpythonpro/tests/test_exemplo.py @@ -0,0 +1,2 @@ +def test_int(): + assert 1 == 0 \ No newline at end of file diff --git a/setup.py b/setup.py index 895662a98..f4c5b0992 100644 --- a/setup.py +++ b/setup.py @@ -117,7 +117,7 @@ def find_package_data( long_description_content_type='text/markdown', author=AUTHOR, author_email=AUTHOR_EMAIL, - license=read('LICENSE'), + license=read('GNU AFFERO GENERAL PUBLIC LICENSE'), url=URL, packages=find_packages(exclude=["tests.*", "tests"]), package_data=find_package_data(PACKAGE, only_in_packages=False), From 2f75febfc0dfe09476c11c41c97457824cebe473 Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Fri, 9 Sep 2022 18:49:12 -0300 Subject: [PATCH 07/19] Inserido teste com pytest close #731 --- .travis.yml | 2 +- Libpythonpro/tests/test_exemplo.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e9a9a9bef..70948b69b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,4 +5,4 @@ python: install: - pip install -q -r requirements-dev.txt - flake8 - - pytest Libpythonpro \ No newline at end of file + - pytest Libpythonpro Carlos \ No newline at end of file diff --git a/Libpythonpro/tests/test_exemplo.py b/Libpythonpro/tests/test_exemplo.py index 41c6a2761..470a3111a 100644 --- a/Libpythonpro/tests/test_exemplo.py +++ b/Libpythonpro/tests/test_exemplo.py @@ -1,2 +1,2 @@ def test_int(): - assert 1 == 0 \ No newline at end of file + assert 1 == 1 \ No newline at end of file From ac4327e10af880ec8c0df19504b816155bf35b84 Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Sun, 11 Sep 2022 15:03:42 -0300 Subject: [PATCH 08/19] Configurado Travis CI close #733 --- .travis.yml | 2 +- README.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 70948b69b..0eb430124 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: python python: - 3.10 - + - 2.7 install: - pip install -q -r requirements-dev.txt - flake8 diff --git a/README.md b/README.md index 9971f75e1..3deff37c6 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ Nesse curso é ensinado como contribuir com projetos de código aberto Link para o curso [Python Pro](https://www.python.pro.br/) -[![Build Status](https://travis-ci.org/pythonprobr/libpythonpro.svg?branch=master)](https://travis-ci.org/pythonprobr/libpythonpro) +[![Build Status](https://app.travis-ci.com/Carloshbfreire/libpythonpro-1.svg?branch=master)](https://app.travis-ci.com/Carloshbfreire/libpythonpro-1) + [![Updates](https://pyup.io/repos/github/pythonprobr/libpythonpro/shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) [![Python 3](https://pyup.io/repos/github/pythonprobr/libpythonpro/python-3-shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) [![codecov](https://codecov.io/gh/pythonprobr/libpythonpro/branch/master/graph/badge.svg)](https://codecov.io/gh/pythonprobr/libpythonpro) From 570c012951493c4e54417e359359f47438416e9c Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Mon, 12 Sep 2022 13:58:54 -0300 Subject: [PATCH 09/19] =?UTF-8?q?Acrecentada=20cobertura=20de=20c=C3=B3dig?= =?UTF-8?q?o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #735 --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0eb430124..829dfd719 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,8 @@ python: - 3.10 - 2.7 install: - - pip install -q -r requirements-dev.txt + - pip install -q -r requirements-dev.txt codecov - flake8 - - pytest Libpythonpro Carlos \ No newline at end of file + - pytest Libpythonpro --cov=libpythonpro-1 +after_success: + - codecov \ No newline at end of file From 23a0cff69bb839a6af16b83f8dc1c3de55d74360 Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Wed, 21 Sep 2022 11:43:55 -0300 Subject: [PATCH 10/19] =?UTF-8?q?Aula=20de=20implementa=C3=A7=C3=A3o=20de?= =?UTF-8?q?=20conex=C3=A3o,=20Sess=C3=A3o=20e=20usu=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Libpythonpro/spam/__init__.py | 0 Libpythonpro/spam/db.py | 25 ++++++++++++ Libpythonpro/spam/modelos.py | 4 ++ Libpythonpro/spam/test_spam/__init__.py | 0 .../spam/test_spam/enviador_de_email.py | 9 +++++ .../spam/test_spam/testes_usuarios.py | 25 ++++++++++++ Libpythonpro/tests/test_spam/__init__.py | 0 .../tests/test_spam/test_enviador_de_email.py | 38 +++++++++++++++++++ 8 files changed, 101 insertions(+) create mode 100644 Libpythonpro/spam/__init__.py create mode 100644 Libpythonpro/spam/db.py create mode 100644 Libpythonpro/spam/modelos.py create mode 100644 Libpythonpro/spam/test_spam/__init__.py create mode 100644 Libpythonpro/spam/test_spam/enviador_de_email.py create mode 100644 Libpythonpro/spam/test_spam/testes_usuarios.py create mode 100644 Libpythonpro/tests/test_spam/__init__.py create mode 100644 Libpythonpro/tests/test_spam/test_enviador_de_email.py diff --git a/Libpythonpro/spam/__init__.py b/Libpythonpro/spam/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Libpythonpro/spam/db.py b/Libpythonpro/spam/db.py new file mode 100644 index 000000000..3a0f55656 --- /dev/null +++ b/Libpythonpro/spam/db.py @@ -0,0 +1,25 @@ +class Sessao: + contador = 0 + usuarios = [] + + def salvar(self, usuario): + Sessao.contador += 1 + usuario.id = Sessao.contador + self.usuarios.append(usuario) + + def listar(self): + return self.usuarios + + def roll_back(self): + pass + + def fechar(self): + pass + + +class Conexao: + def gerar_sessao(self): + return Sessao() + + def fechar(self): + pass diff --git a/Libpythonpro/spam/modelos.py b/Libpythonpro/spam/modelos.py new file mode 100644 index 000000000..60cb0068e --- /dev/null +++ b/Libpythonpro/spam/modelos.py @@ -0,0 +1,4 @@ +class Usuario: + def __init__(self, nome): + self.nome = nome + self.id = None diff --git a/Libpythonpro/spam/test_spam/__init__.py b/Libpythonpro/spam/test_spam/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Libpythonpro/spam/test_spam/enviador_de_email.py b/Libpythonpro/spam/test_spam/enviador_de_email.py new file mode 100644 index 000000000..add1ac3b4 --- /dev/null +++ b/Libpythonpro/spam/test_spam/enviador_de_email.py @@ -0,0 +1,9 @@ +class Enviador: + def enviar(self, remetente, destinatário, assunto, corpo): + if '@' not in remetente: + raise EmailInvalido(f'Email de Remetente Inválido:{remetente}') + return remetente + + +class EmailInvalido(Exception): + pass diff --git a/Libpythonpro/spam/test_spam/testes_usuarios.py b/Libpythonpro/spam/test_spam/testes_usuarios.py new file mode 100644 index 000000000..ff680f87a --- /dev/null +++ b/Libpythonpro/spam/test_spam/testes_usuarios.py @@ -0,0 +1,25 @@ +from Libpythonpro.spam.db import Conexao +from Libpythonpro.spam.modelos import Usuario + + +def test_salvar_usuario(): + conexao = Conexao() + sessao = conexao.gerar_sessao() + usuario= Usuario(nome='Carlos') + sessao.salvar(usuario) + assert isinstance(usuario.id, int) + sessao.roll_back() + sessao.fechar() + conexao.fechar() + + +def test_listar_usuario(): + conexao = Conexao() + sessao = conexao.gerar_sessao() + usuarios = [Usuario(nome='Carlos'), Usuario(nome='Givani')] + for usuario in usuarios: + sessao.salvar(usuario) + assert usuarios == sessao.listar() + sessao.roll_back() + sessao.fechar() + conexao.fechar() \ No newline at end of file diff --git a/Libpythonpro/tests/test_spam/__init__.py b/Libpythonpro/tests/test_spam/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Libpythonpro/tests/test_spam/test_enviador_de_email.py b/Libpythonpro/tests/test_spam/test_enviador_de_email.py new file mode 100644 index 000000000..7567eff71 --- /dev/null +++ b/Libpythonpro/tests/test_spam/test_enviador_de_email.py @@ -0,0 +1,38 @@ +import pytest + +from Libpythonpro.spam.test_spam.enviador_de_email import Enviador, EmailInvalido + + +def test_criar_enviador_de_email(): + enviador= Enviador() + assert enviador is not None + +@pytest.mark.parametrize( + 'destinatario', + ['foo@bar.com.br','renzo@python.pro.br'] +) +def test_remetente(destinatario): + enviador = Enviador() + destinatario + resultado = enviador.enviar( + destinatario, + 'luciano@python.pro.br', + 'Cursos Python Pro', + 'Primeira Turma Guido Von Rossum aberta.') + assert destinatario in resultado + + +@pytest.mark.parametrize( + 'remetente', + ['','renzo'] +) +def test_remetente_invalido(remetente): + enviador = Enviador() + with pytest.raises(EmailInvalido): + enviador.enviar( + remetente, + 'luciano@python.pro.br', + 'Cursos Python Pro', + 'Primeira Turma Guido Von Rossum aberta.' + ) + From a23a6e16ccc4533e9bfd81fcedcf294d24a78e23 Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Mon, 26 Sep 2022 16:23:02 -0300 Subject: [PATCH 11/19] =?UTF-8?q?Terminado=20o=20M=C3=B3dulo=20Pytest=20Fi?= =?UTF-8?q?xtures=20do=20Pytools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Libpythonpro/spam/db.py | 22 -------- Libpythonpro/spam/main.py | 8 +++ .../spam/test_spam/testes_usuarios.py | 18 ++----- Libpythonpro/tests/test_spam/conftest.py | 51 +++++++++++++++++++ .../test_envio_para_base_de_usuarios.py | 11 ++++ 5 files changed, 75 insertions(+), 35 deletions(-) create mode 100644 Libpythonpro/spam/main.py create mode 100644 Libpythonpro/tests/test_spam/conftest.py create mode 100644 Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py diff --git a/Libpythonpro/spam/db.py b/Libpythonpro/spam/db.py index 3a0f55656..b28b04f64 100644 --- a/Libpythonpro/spam/db.py +++ b/Libpythonpro/spam/db.py @@ -1,25 +1,3 @@ -class Sessao: - contador = 0 - usuarios = [] - def salvar(self, usuario): - Sessao.contador += 1 - usuario.id = Sessao.contador - self.usuarios.append(usuario) - def listar(self): - return self.usuarios - def roll_back(self): - pass - - def fechar(self): - pass - - -class Conexao: - def gerar_sessao(self): - return Sessao() - - def fechar(self): - pass diff --git a/Libpythonpro/spam/main.py b/Libpythonpro/spam/main.py new file mode 100644 index 000000000..fd0a64903 --- /dev/null +++ b/Libpythonpro/spam/main.py @@ -0,0 +1,8 @@ +class EnviadorDeSpam: + def __init__(self, sessao, enviador): + self.enviador = enviador + self.sessao = sessao + + def enviar_emails(self, remetente, assunto, corpo): + pass + diff --git a/Libpythonpro/spam/test_spam/testes_usuarios.py b/Libpythonpro/spam/test_spam/testes_usuarios.py index ff680f87a..660342142 100644 --- a/Libpythonpro/spam/test_spam/testes_usuarios.py +++ b/Libpythonpro/spam/test_spam/testes_usuarios.py @@ -1,25 +1,17 @@ -from Libpythonpro.spam.db import Conexao from Libpythonpro.spam.modelos import Usuario -def test_salvar_usuario(): - conexao = Conexao() - sessao = conexao.gerar_sessao() +def test_salvar_usuario(sessao): usuario= Usuario(nome='Carlos') sessao.salvar(usuario) assert isinstance(usuario.id, int) - sessao.roll_back() - sessao.fechar() - conexao.fechar() -def test_listar_usuario(): - conexao = Conexao() - sessao = conexao.gerar_sessao() +def test_listar_usuario(sessao): usuarios = [Usuario(nome='Carlos'), Usuario(nome='Givani')] for usuario in usuarios: sessao.salvar(usuario) assert usuarios == sessao.listar() - sessao.roll_back() - sessao.fechar() - conexao.fechar() \ No newline at end of file + + + diff --git a/Libpythonpro/tests/test_spam/conftest.py b/Libpythonpro/tests/test_spam/conftest.py new file mode 100644 index 000000000..bbb25c720 --- /dev/null +++ b/Libpythonpro/tests/test_spam/conftest.py @@ -0,0 +1,51 @@ +from time import sleep + +import pytest + + +class Sessao: + contador = 0 + usuarios = [] + + def salvar(self, usuario): + Sessao.contador += 1 + usuario.id = Sessao.contador + self.usuarios.append(usuario) + + def listar(self): + return self.usuarios + + def roll_back(self): + self.usuarios.clear() + + def fechar(self): + pass + + +class Conexao: + + def __init__(self): + sleep(1) + + def gerar_sessao(self): + return Sessao() + + def fechar(self): + pass + + +@pytest.fixture(scope= 'session') +def conexao(): + #Setup + conexao_obj = Conexao() + yield conexao_obj + #Tear Down + conexao_obj.fechar() + + +@pytest.fixture +def sessao(conexao): + sessao_obj = conexao.gerar_sessao() + yield sessao_obj + sessao_obj.roll_back() + sessao_obj.fechar() diff --git a/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py b/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py new file mode 100644 index 000000000..9978480d5 --- /dev/null +++ b/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py @@ -0,0 +1,11 @@ +from Libpythonpro.spam.main import EnviadorDeSpam +from Libpythonpro.spam.test_spam.enviador_de_email import Enviador + + +def test_envio_de_spam(sessao): + enviador_de_spam= EnviadorDeSpam(sessao, Enviador()) + enviador_de_spam.enviar_emails( + 'carhb@outlook.com', + 'Curso Pythonpro', + 'Confira os módulos fantásticos' + ) From ff62408a2508f8b3b9b2954e362f39b84d83d4af Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Tue, 27 Sep 2022 16:51:00 -0300 Subject: [PATCH 12/19] =?UTF-8?q?Terminado=20o=20Exercicio=20de=20produ?= =?UTF-8?q?=C3=A7ao=20de=20c=C3=B3digo=20testavel.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Libpythonpro/spam/db.py | 22 ++++++++++++++++ Libpythonpro/spam/main.py | 9 ++++++- Libpythonpro/spam/modelos.py | 3 ++- .../spam/test_spam/enviador_de_email.py | 4 +++ .../spam/test_spam/testes_usuarios.py | 7 +++-- Libpythonpro/tests/test_spam/conftest.py | 15 ++++++++--- .../test_envio_para_base_de_usuarios.py | 26 ++++++++++++++++--- 7 files changed, 76 insertions(+), 10 deletions(-) diff --git a/Libpythonpro/spam/db.py b/Libpythonpro/spam/db.py index b28b04f64..3a0f55656 100644 --- a/Libpythonpro/spam/db.py +++ b/Libpythonpro/spam/db.py @@ -1,3 +1,25 @@ +class Sessao: + contador = 0 + usuarios = [] + def salvar(self, usuario): + Sessao.contador += 1 + usuario.id = Sessao.contador + self.usuarios.append(usuario) + def listar(self): + return self.usuarios + def roll_back(self): + pass + + def fechar(self): + pass + + +class Conexao: + def gerar_sessao(self): + return Sessao() + + def fechar(self): + pass diff --git a/Libpythonpro/spam/main.py b/Libpythonpro/spam/main.py index fd0a64903..3d45e0b07 100644 --- a/Libpythonpro/spam/main.py +++ b/Libpythonpro/spam/main.py @@ -4,5 +4,12 @@ def __init__(self, sessao, enviador): self.sessao = sessao def enviar_emails(self, remetente, assunto, corpo): - pass + for usuario in self.sessao.listar(): + self.enviador.enviar( + remetente, + usuario.email, + assunto, + corpo + ) + diff --git a/Libpythonpro/spam/modelos.py b/Libpythonpro/spam/modelos.py index 60cb0068e..093b35a2a 100644 --- a/Libpythonpro/spam/modelos.py +++ b/Libpythonpro/spam/modelos.py @@ -1,4 +1,5 @@ class Usuario: - def __init__(self, nome): + def __init__(self, nome, email): + self.email = email self.nome = nome self.id = None diff --git a/Libpythonpro/spam/test_spam/enviador_de_email.py b/Libpythonpro/spam/test_spam/enviador_de_email.py index add1ac3b4..426b2bf13 100644 --- a/Libpythonpro/spam/test_spam/enviador_de_email.py +++ b/Libpythonpro/spam/test_spam/enviador_de_email.py @@ -1,7 +1,11 @@ class Enviador: + def __init__(self): + self.qtd_email_enviados = 0 + def enviar(self, remetente, destinatário, assunto, corpo): if '@' not in remetente: raise EmailInvalido(f'Email de Remetente Inválido:{remetente}') + self.qtd_email_enviados += 1 return remetente diff --git a/Libpythonpro/spam/test_spam/testes_usuarios.py b/Libpythonpro/spam/test_spam/testes_usuarios.py index 660342142..f13572d73 100644 --- a/Libpythonpro/spam/test_spam/testes_usuarios.py +++ b/Libpythonpro/spam/test_spam/testes_usuarios.py @@ -2,13 +2,16 @@ def test_salvar_usuario(sessao): - usuario= Usuario(nome='Carlos') + usuario= Usuario(nome='Carlos', email= 'carhb@outlook.com' ) sessao.salvar(usuario) assert isinstance(usuario.id, int) def test_listar_usuario(sessao): - usuarios = [Usuario(nome='Carlos'), Usuario(nome='Givani')] + usuarios = [ + Usuario(nome='Carlos', email='carhb@outlook.com'), + Usuario(nome='Givani', email='carhb@outlook.com') + ] for usuario in usuarios: sessao.salvar(usuario) assert usuarios == sessao.listar() diff --git a/Libpythonpro/tests/test_spam/conftest.py b/Libpythonpro/tests/test_spam/conftest.py index bbb25c720..494d6ed25 100644 --- a/Libpythonpro/tests/test_spam/conftest.py +++ b/Libpythonpro/tests/test_spam/conftest.py @@ -34,12 +34,12 @@ def fechar(self): pass -@pytest.fixture(scope= 'session') +@pytest.fixture(scope='session') def conexao(): - #Setup + # Setup conexao_obj = Conexao() yield conexao_obj - #Tear Down + # Tear Down conexao_obj.fechar() @@ -49,3 +49,12 @@ def sessao(conexao): yield sessao_obj sessao_obj.roll_back() sessao_obj.fechar() + + + + + + + + + diff --git a/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py b/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py index 9978480d5..e71334c04 100644 --- a/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py +++ b/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py @@ -1,11 +1,31 @@ +import pytest + from Libpythonpro.spam.main import EnviadorDeSpam +from Libpythonpro.spam.modelos import Usuario from Libpythonpro.spam.test_spam.enviador_de_email import Enviador - -def test_envio_de_spam(sessao): - enviador_de_spam= EnviadorDeSpam(sessao, Enviador()) +@pytest.mark.parametrize( + 'usuarios', + [ + [ + Usuario(nome='Carlos', email='carhb@outlook.com'), + Usuario(nome='Givani', email='carhb@outlook.com') + ], + [ + Usuario(nome='Carlos', email='carhb@outlook.com') + ] + ] +) +def test_qde_de_spam(sessao, usuarios): + for usuario in usuarios: + sessao.salvar(usuario) + enviador = Enviador() + enviador_de_spam= EnviadorDeSpam(sessao, enviador) enviador_de_spam.enviar_emails( 'carhb@outlook.com', 'Curso Pythonpro', 'Confira os módulos fantásticos' ) + assert len(usuarios) == enviador.qtd_email_enviados + + From 992fc186ec27a7898e81d8c43782c5b4b79dd61d Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Wed, 28 Sep 2022 15:07:16 -0300 Subject: [PATCH 13/19] =?UTF-8?q?Terminado=20o=20Exercicio=20de=20Inje?= =?UTF-8?q?=C3=A7=C3=A3o=20de=20depend=C3=AAncia.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spam/test_spam/enviador_de_email.py | 6 +-- .../test_envio_para_base_de_usuarios.py | 40 +++++++++++++++++-- .../test_spam/testes_usuarios.py | 0 3 files changed, 38 insertions(+), 8 deletions(-) rename Libpythonpro/{spam => tests}/test_spam/testes_usuarios.py (100%) diff --git a/Libpythonpro/spam/test_spam/enviador_de_email.py b/Libpythonpro/spam/test_spam/enviador_de_email.py index 426b2bf13..b500c4f27 100644 --- a/Libpythonpro/spam/test_spam/enviador_de_email.py +++ b/Libpythonpro/spam/test_spam/enviador_de_email.py @@ -1,11 +1,7 @@ class Enviador: - def __init__(self): - self.qtd_email_enviados = 0 - - def enviar(self, remetente, destinatário, assunto, corpo): + def enviar(self, remetente, destinatário, assunto, corpo): if '@' not in remetente: raise EmailInvalido(f'Email de Remetente Inválido:{remetente}') - self.qtd_email_enviados += 1 return remetente diff --git a/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py b/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py index e71334c04..690e86fac 100644 --- a/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py +++ b/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py @@ -4,22 +4,37 @@ from Libpythonpro.spam.modelos import Usuario from Libpythonpro.spam.test_spam.enviador_de_email import Enviador + +def test_envio_de_spam(sessao): + enviador_de_spam= EnviadorDeSpam(sessao, Enviador()) + + +class EnviadorMock(Enviador): + def __init__(self): + super().__init__() + self.qtd_email_enviados = 0 + self.parametros_de_envio = None + + def enviar(self, remetente, destinatário, assunto, corpo): + self.parametros_de_envio = (remetente, destinatário, assunto, corpo) + self.qtd_email_enviados += 1 + @pytest.mark.parametrize( 'usuarios', [ [ Usuario(nome='Carlos', email='carhb@outlook.com'), - Usuario(nome='Givani', email='carhb@outlook.com') + Usuario(nome='Givani', email='givanifcf@hotmail.com') ], [ Usuario(nome='Carlos', email='carhb@outlook.com') ] ] ) -def test_qde_de_spam(sessao, usuarios): +def test_qtd_de_spam(sessao, usuarios): for usuario in usuarios: sessao.salvar(usuario) - enviador = Enviador() + enviador = EnviadorMock() enviador_de_spam= EnviadorDeSpam(sessao, enviador) enviador_de_spam.enviar_emails( 'carhb@outlook.com', @@ -29,3 +44,22 @@ def test_qde_de_spam(sessao, usuarios): assert len(usuarios) == enviador.qtd_email_enviados +def test_parametros_de_spam(sessao): + usuario = Usuario(nome='Carlos', email='carhb@outlook.com') + sessao.salvar(usuario) + enviador = EnviadorMock() + enviador_de_spam= EnviadorDeSpam(sessao, enviador) + enviador_de_spam.enviar_emails( + 'givanifcf@hotmail.com', + 'Curso Pythonpro', + 'Confira os módulos fantásticos' + ) + assert enviador.parametros_de_envio ==( + 'givanifcf@hotmail.com', + 'carhb@outlook.com', + 'Curso Pythonpro', + 'Confira os módulos fantásticos' + ) + + + diff --git a/Libpythonpro/spam/test_spam/testes_usuarios.py b/Libpythonpro/tests/test_spam/testes_usuarios.py similarity index 100% rename from Libpythonpro/spam/test_spam/testes_usuarios.py rename to Libpythonpro/tests/test_spam/testes_usuarios.py From 8fc0fbda17f6fad0da14e5a671c37040fcdf672a Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Thu, 29 Sep 2022 15:49:52 -0300 Subject: [PATCH 14/19] Terminado o Exercicio sobre o uso do Mock --- .../test_envio_para_base_de_usuarios.py | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py b/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py index 690e86fac..6eb8c09a9 100644 --- a/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py +++ b/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py @@ -1,3 +1,5 @@ +from unittest.mock import Mock + import pytest from Libpythonpro.spam.main import EnviadorDeSpam @@ -9,16 +11,6 @@ def test_envio_de_spam(sessao): enviador_de_spam= EnviadorDeSpam(sessao, Enviador()) -class EnviadorMock(Enviador): - def __init__(self): - super().__init__() - self.qtd_email_enviados = 0 - self.parametros_de_envio = None - - def enviar(self, remetente, destinatário, assunto, corpo): - self.parametros_de_envio = (remetente, destinatário, assunto, corpo) - self.qtd_email_enviados += 1 - @pytest.mark.parametrize( 'usuarios', [ @@ -34,27 +26,27 @@ def enviar(self, remetente, destinatário, assunto, corpo): def test_qtd_de_spam(sessao, usuarios): for usuario in usuarios: sessao.salvar(usuario) - enviador = EnviadorMock() + enviador = Mock() enviador_de_spam= EnviadorDeSpam(sessao, enviador) enviador_de_spam.enviar_emails( 'carhb@outlook.com', 'Curso Pythonpro', 'Confira os módulos fantásticos' ) - assert len(usuarios) == enviador.qtd_email_enviados + assert len(usuarios) == enviador.enviar.call_count def test_parametros_de_spam(sessao): usuario = Usuario(nome='Carlos', email='carhb@outlook.com') sessao.salvar(usuario) - enviador = EnviadorMock() + enviador = Mock() enviador_de_spam= EnviadorDeSpam(sessao, enviador) enviador_de_spam.enviar_emails( 'givanifcf@hotmail.com', 'Curso Pythonpro', 'Confira os módulos fantásticos' ) - assert enviador.parametros_de_envio ==( + enviador.enviar.assert_called_once_with( 'givanifcf@hotmail.com', 'carhb@outlook.com', 'Curso Pythonpro', From 8c4afe9fe72c4a11eaf4434f8b420c5eb7d73ad4 Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Sat, 1 Oct 2022 14:48:10 -0300 Subject: [PATCH 15/19] =?UTF-8?q?Terminado=20o=20Exercicio=20de=20M=C3=B3d?= =?UTF-8?q?ulo=20como=20objeto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Libpythonpro/github_api.py | 2 -- .../test_spam/test_envio_para_base_de_usuarios.py | 1 - Libpythonpro/tests/test_spam/test_github_api.py | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 Libpythonpro/tests/test_spam/test_github_api.py diff --git a/Libpythonpro/github_api.py b/Libpythonpro/github_api.py index abc64ed4d..f9926480a 100644 --- a/Libpythonpro/github_api.py +++ b/Libpythonpro/github_api.py @@ -12,5 +12,3 @@ def buscar_avatar(usuario): return resp.json()['avatar_url'] -if __name__ == '__main__': - print(buscar_avatar('Carloshbfreire')) diff --git a/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py b/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py index 6eb8c09a9..9d232dbbf 100644 --- a/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py +++ b/Libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py @@ -6,7 +6,6 @@ from Libpythonpro.spam.modelos import Usuario from Libpythonpro.spam.test_spam.enviador_de_email import Enviador - def test_envio_de_spam(sessao): enviador_de_spam= EnviadorDeSpam(sessao, Enviador()) diff --git a/Libpythonpro/tests/test_spam/test_github_api.py b/Libpythonpro/tests/test_spam/test_github_api.py new file mode 100644 index 000000000..86f9e689a --- /dev/null +++ b/Libpythonpro/tests/test_spam/test_github_api.py @@ -0,0 +1,14 @@ +from unittest.mock import Mock + +from Libpythonpro import github_api + + +def test_buscar_avatar(): + resp_mock = Mock() + resp_mock.json.return_value = { + 'login': 'Carloshbfreire', 'id': 107650943, + 'avatar_url': 'https://avatars.githubusercontent.com/u/107650943?v=4', + } + github_api.requests.get = Mock(return_value=resp_mock) + url = github_api.buscar_avatar('Carloshbfreire') + assert 'https://avatars.githubusercontent.com/u/107650943?v=4' == url From 8c367bf1c08da119907ad17c3eca20fdb51b4cd7 Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Sun, 2 Oct 2022 16:35:42 -0300 Subject: [PATCH 16/19] Terminado o Exercicio de Isolamento de Imports --- .../tests/test_spam/test_github_api.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Libpythonpro/tests/test_spam/test_github_api.py b/Libpythonpro/tests/test_spam/test_github_api.py index 86f9e689a..22bd06c3d 100644 --- a/Libpythonpro/tests/test_spam/test_github_api.py +++ b/Libpythonpro/tests/test_spam/test_github_api.py @@ -1,14 +1,26 @@ from unittest.mock import Mock -from Libpythonpro import github_api +import pytest +from Libpythonpro import github_api -def test_buscar_avatar(): +@pytest.fixture +def avatar_url(): resp_mock = Mock() + url = 'https://avatars.githubusercontent.com/u/107650943?v=4' resp_mock.json.return_value = { 'login': 'Carloshbfreire', 'id': 107650943, - 'avatar_url': 'https://avatars.githubusercontent.com/u/107650943?v=4', + 'avatar_url': url, } + get_original = github_api.requests.get github_api.requests.get = Mock(return_value=resp_mock) + yield url + github_api.requests.get = get_original + +def test_buscar_avatar(avatar_url): + url = github_api.buscar_avatar('Carloshbfreire') + assert avatar_url == url + +def test_buscar_avatar_integraçao(): url = github_api.buscar_avatar('Carloshbfreire') assert 'https://avatars.githubusercontent.com/u/107650943?v=4' == url From cfa394b15bc3de7c64ded9c611ccf04b31b4c83c Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Mon, 3 Oct 2022 15:32:04 -0300 Subject: [PATCH 17/19] Terminado o Exercicio de Biblioteca pytest-mock. --- Libpythonpro/tests/test_spam/test_github_api.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Libpythonpro/tests/test_spam/test_github_api.py b/Libpythonpro/tests/test_spam/test_github_api.py index 22bd06c3d..79839811c 100644 --- a/Libpythonpro/tests/test_spam/test_github_api.py +++ b/Libpythonpro/tests/test_spam/test_github_api.py @@ -5,17 +5,16 @@ from Libpythonpro import github_api @pytest.fixture -def avatar_url(): +def avatar_url(mocker): resp_mock = Mock() url = 'https://avatars.githubusercontent.com/u/107650943?v=4' resp_mock.json.return_value = { 'login': 'Carloshbfreire', 'id': 107650943, 'avatar_url': url, } - get_original = github_api.requests.get - github_api.requests.get = Mock(return_value=resp_mock) - yield url - github_api.requests.get = get_original + get_mock = mocker.patch('Libpythonpro.github_api.requests.get') + get_mock.return_value = resp_mock + return url def test_buscar_avatar(avatar_url): url = github_api.buscar_avatar('Carloshbfreire') From 7c96a87cda15c5a6da5c10e95eeed59cee3c77cc Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Sun, 16 Oct 2022 06:12:13 -0300 Subject: [PATCH 18/19] Alterado gestor de dependencias para pipenv. close #737 --- .travis.yml | 10 -- Libpythonpro.egg-info/.travis.yml | 14 ++ Pipfile | 14 +- Pipfile.lock | 264 +++++++++++++++--------------- 4 files changed, 156 insertions(+), 146 deletions(-) delete mode 100644 .travis.yml create mode 100644 Libpythonpro.egg-info/.travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 829dfd719..000000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: python -python: - - 3.10 - - 2.7 - install: - - pip install -q -r requirements-dev.txt codecov - - flake8 - - pytest Libpythonpro --cov=libpythonpro-1 -after_success: - - codecov \ No newline at end of file diff --git a/Libpythonpro.egg-info/.travis.yml b/Libpythonpro.egg-info/.travis.yml new file mode 100644 index 000000000..28b8e956d --- /dev/null +++ b/Libpythonpro.egg-info/.travis.yml @@ -0,0 +1,14 @@ +language: python +python: + - 3.10 + + - 2.7 +install: + - pip install -q pipenv codecov + - pipenv sync --dev +scripts: + - flake8 + - pytest Libpythonpro --cov=Libpythonpro +after_success: + - codecov + diff --git a/Pipfile b/Pipfile index af5c7333d..bf526e176 100644 --- a/Pipfile +++ b/Pipfile @@ -1,7 +1,13 @@ [[source]] -name = "pypi" url = "https://pypi.org/simple" verify_ssl = true +name = "pypi" + +[packages] +requests = "*" + +[requires] +python_version = "3.10" [dev-packages] flake8 = "*" @@ -9,9 +15,3 @@ pytest = "*" coverage = "*" pytest-cov = "*" pytest-mock = "*" - -[packages] -requests = "*" - -[requires] -python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock index 8a647ca6f..eaf97de3b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "36b4d15ab997722625c5463b1a4e8164dfc3dd1788d6e7e90b62a7d7b5ed6a50" + "sha256": "40f01b0d244d9ca0542a742bdabfdde85d908e1256f815c7e145b99c9ffe3c97" }, "pipfile-spec": 6, "requires": { - "python_version": "3.7" + "python_version": "3.10" }, "sources": [ { @@ -18,216 +18,222 @@ "default": { "certifi": { "hashes": [ - "sha256:046832c04d4e752f37383b628bc601a7ea7211496b4638f6514d0e5b9acc4939", - "sha256:945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695" + "sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14", + "sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382" ], - "version": "==2019.6.16" + "markers": "python_version >= '3.6'", + "version": "==2022.9.24" }, - "chardet": { + "charset-normalizer": { "hashes": [ - "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", - "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" + "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845", + "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f" ], - "version": "==3.0.4" + "markers": "python_version >= '3.6'", + "version": "==2.1.1" }, "idna": { "hashes": [ - "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", - "sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c" + "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4", + "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2" ], - "version": "==2.8" + "markers": "python_version >= '3.5'", + "version": "==3.4" }, "requests": { "hashes": [ - "sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4", - "sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31" + "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983", + "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349" ], "index": "pypi", - "version": "==2.22.0" + "version": "==2.28.1" }, "urllib3": { "hashes": [ - "sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1", - "sha256:dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232" + "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e", + "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997" ], - "version": "==1.25.3" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4'", + "version": "==1.26.12" } }, "develop": { - "atomicwrites": { + "attrs": { "hashes": [ - "sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4", - "sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6" + "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6", + "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c" ], - "version": "==1.3.0" + "markers": "python_version >= '3.5'", + "version": "==22.1.0" }, - "attrs": { + "colorama": { "hashes": [ - "sha256:69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", - "sha256:f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399" + "sha256:854bf444933e37f5824ae7bfc1e98d5bce2ebe4160d46b5edf346a89358e99da", + "sha256:e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4" ], - "version": "==19.1.0" + "markers": "sys_platform == 'win32'", + "version": "==0.4.5" }, "coverage": { - "hashes": [ - "sha256:3684fabf6b87a369017756b551cef29e505cb155ddb892a7a29277b978da88b9", - "sha256:39e088da9b284f1bd17c750ac672103779f7954ce6125fd4382134ac8d152d74", - "sha256:3c205bc11cc4fcc57b761c2da73b9b72a59f8d5ca89979afb0c1c6f9e53c7390", - "sha256:465ce53a8c0f3a7950dfb836438442f833cf6663d407f37d8c52fe7b6e56d7e8", - "sha256:48020e343fc40f72a442c8a1334284620f81295256a6b6ca6d8aa1350c763bbe", - "sha256:5296fc86ab612ec12394565c500b412a43b328b3907c0d14358950d06fd83baf", - "sha256:5f61bed2f7d9b6a9ab935150a6b23d7f84b8055524e7be7715b6513f3328138e", - "sha256:68a43a9f9f83693ce0414d17e019daee7ab3f7113a70c79a3dd4c2f704e4d741", - "sha256:6b8033d47fe22506856fe450470ccb1d8ba1ffb8463494a15cfc96392a288c09", - "sha256:7ad7536066b28863e5835e8cfeaa794b7fe352d99a8cded9f43d1161be8e9fbd", - "sha256:7bacb89ccf4bedb30b277e96e4cc68cd1369ca6841bde7b005191b54d3dd1034", - "sha256:839dc7c36501254e14331bcb98b27002aa415e4af7ea039d9009409b9d2d5420", - "sha256:8f9a95b66969cdea53ec992ecea5406c5bd99c9221f539bca1e8406b200ae98c", - "sha256:932c03d2d565f75961ba1d3cec41ddde00e162c5b46d03f7423edcb807734eab", - "sha256:988529edadc49039d205e0aa6ce049c5ccda4acb2d6c3c5c550c17e8c02c05ba", - "sha256:998d7e73548fe395eeb294495a04d38942edb66d1fa61eb70418871bc621227e", - "sha256:9de60893fb447d1e797f6bf08fdf0dbcda0c1e34c1b06c92bd3a363c0ea8c609", - "sha256:9e80d45d0c7fcee54e22771db7f1b0b126fb4a6c0a2e5afa72f66827207ff2f2", - "sha256:a545a3dfe5082dc8e8c3eb7f8a2cf4f2870902ff1860bd99b6198cfd1f9d1f49", - "sha256:a5d8f29e5ec661143621a8f4de51adfb300d7a476224156a39a392254f70687b", - "sha256:aca06bfba4759bbdb09bf52ebb15ae20268ee1f6747417837926fae990ebc41d", - "sha256:bb23b7a6fd666e551a3094ab896a57809e010059540ad20acbeec03a154224ce", - "sha256:bfd1d0ae7e292105f29d7deaa9d8f2916ed8553ab9d5f39ec65bcf5deadff3f9", - "sha256:c62ca0a38958f541a73cf86acdab020c2091631c137bd359c4f5bddde7b75fd4", - "sha256:c709d8bda72cf4cd348ccec2a4881f2c5848fd72903c185f363d361b2737f773", - "sha256:c968a6aa7e0b56ecbd28531ddf439c2ec103610d3e2bf3b75b813304f8cb7723", - "sha256:df785d8cb80539d0b55fd47183264b7002077859028dfe3070cf6359bf8b2d9c", - "sha256:f406628ca51e0ae90ae76ea8398677a921b36f0bd71aab2099dfed08abd0322f", - "sha256:f46087bbd95ebae244a0eda01a618aff11ec7a069b15a3ef8f6b520db523dcf1", - "sha256:f8019c5279eb32360ca03e9fac40a12667715546eed5c5eb59eb381f2f501260", - "sha256:fc5f4d209733750afd2714e9109816a29500718b32dd9a5db01c0cb3a019b96a" + "extras": [ + "toml" + ], + "hashes": [ + "sha256:027018943386e7b942fa832372ebc120155fd970837489896099f5cfa2890f79", + "sha256:11b990d520ea75e7ee8dcab5bc908072aaada194a794db9f6d7d5cfd19661e5a", + "sha256:12adf310e4aafddc58afdb04d686795f33f4d7a6fa67a7a9d4ce7d6ae24d949f", + "sha256:1431986dac3923c5945271f169f59c45b8802a114c8f548d611f2015133df77a", + "sha256:1ef221513e6f68b69ee9e159506d583d31aa3567e0ae84eaad9d6ec1107dddaa", + "sha256:20c8ac5386253717e5ccc827caad43ed66fea0efe255727b1053a8154d952398", + "sha256:2198ea6fc548de52adc826f62cb18554caedfb1d26548c1b7c88d8f7faa8f6ba", + "sha256:255758a1e3b61db372ec2736c8e2a1fdfaf563977eedbdf131de003ca5779b7d", + "sha256:265de0fa6778d07de30bcf4d9dc471c3dc4314a23a3c6603d356a3c9abc2dfcf", + "sha256:33a7da4376d5977fbf0a8ed91c4dffaaa8dbf0ddbf4c8eea500a2486d8bc4d7b", + "sha256:42eafe6778551cf006a7c43153af1211c3aaab658d4d66fa5fcc021613d02518", + "sha256:4433b90fae13f86fafff0b326453dd42fc9a639a0d9e4eec4d366436d1a41b6d", + "sha256:4a5375e28c5191ac38cca59b38edd33ef4cc914732c916f2929029b4bfb50795", + "sha256:4a8dbc1f0fbb2ae3de73eb0bdbb914180c7abfbf258e90b311dcd4f585d44bd2", + "sha256:59f53f1dc5b656cafb1badd0feb428c1e7bc19b867479ff72f7a9dd9b479f10e", + "sha256:5dbec3b9095749390c09ab7c89d314727f18800060d8d24e87f01fb9cfb40b32", + "sha256:633713d70ad6bfc49b34ead4060531658dc6dfc9b3eb7d8a716d5873377ab745", + "sha256:6b07130585d54fe8dff3d97b93b0e20290de974dc8177c320aeaf23459219c0b", + "sha256:6c4459b3de97b75e3bd6b7d4b7f0db13f17f504f3d13e2a7c623786289dd670e", + "sha256:6d4817234349a80dbf03640cec6109cd90cba068330703fa65ddf56b60223a6d", + "sha256:723e8130d4ecc8f56e9a611e73b31219595baa3bb252d539206f7bbbab6ffc1f", + "sha256:784f53ebc9f3fd0e2a3f6a78b2be1bd1f5575d7863e10c6e12504f240fd06660", + "sha256:7b6be138d61e458e18d8e6ddcddd36dd96215edfe5f1168de0b1b32635839b62", + "sha256:7ccf362abd726b0410bf8911c31fbf97f09f8f1061f8c1cf03dfc4b6372848f6", + "sha256:83516205e254a0cb77d2d7bb3632ee019d93d9f4005de31dca0a8c3667d5bc04", + "sha256:851cf4ff24062c6aec510a454b2584f6e998cada52d4cb58c5e233d07172e50c", + "sha256:8f830ed581b45b82451a40faabb89c84e1a998124ee4212d440e9c6cf70083e5", + "sha256:94e2565443291bd778421856bc975d351738963071e9b8839ca1fc08b42d4bef", + "sha256:95203854f974e07af96358c0b261f1048d8e1083f2de9b1c565e1be4a3a48cfc", + "sha256:97117225cdd992a9c2a5515db1f66b59db634f59d0679ca1fa3fe8da32749cae", + "sha256:98e8a10b7a314f454d9eff4216a9a94d143a7ee65018dd12442e898ee2310578", + "sha256:a1170fa54185845505fbfa672f1c1ab175446c887cce8212c44149581cf2d466", + "sha256:a6b7d95969b8845250586f269e81e5dfdd8ff828ddeb8567a4a2eaa7313460c4", + "sha256:a8fb6cf131ac4070c9c5a3e21de0f7dc5a0fbe8bc77c9456ced896c12fcdad91", + "sha256:af4fffaffc4067232253715065e30c5a7ec6faac36f8fc8d6f64263b15f74db0", + "sha256:b4a5be1748d538a710f87542f22c2cad22f80545a847ad91ce45e77417293eb4", + "sha256:b5604380f3415ba69de87a289a2b56687faa4fe04dbee0754bfcae433489316b", + "sha256:b9023e237f4c02ff739581ef35969c3739445fb059b060ca51771e69101efffe", + "sha256:bc8ef5e043a2af066fa8cbfc6e708d58017024dc4345a1f9757b329a249f041b", + "sha256:c4ed2820d919351f4167e52425e096af41bfabacb1857186c1ea32ff9983ed75", + "sha256:cca4435eebea7962a52bdb216dec27215d0df64cf27fc1dd538415f5d2b9da6b", + "sha256:d900bb429fdfd7f511f868cedd03a6bbb142f3f9118c09b99ef8dc9bf9643c3c", + "sha256:d9ecf0829c6a62b9b573c7bb6d4dcd6ba8b6f80be9ba4fc7ed50bf4ac9aecd72", + "sha256:dbdb91cd8c048c2b09eb17713b0c12a54fbd587d79adcebad543bc0cd9a3410b", + "sha256:de3001a203182842a4630e7b8d1a2c7c07ec1b45d3084a83d5d227a3806f530f", + "sha256:e07f4a4a9b41583d6eabec04f8b68076ab3cd44c20bd29332c6572dda36f372e", + "sha256:ef8674b0ee8cc11e2d574e3e2998aea5df5ab242e012286824ea3c6970580e53", + "sha256:f4f05d88d9a80ad3cac6244d36dd89a3c00abc16371769f1340101d3cb899fc3", + "sha256:f642e90754ee3e06b0e7e51bce3379590e76b7f76b708e1a71ff043f87025c84", + "sha256:fc2af30ed0d5ae0b1abdb4ebdce598eafd5b35397d4d75deb341a614d333d987" ], "index": "pypi", - "version": "==4.5.3" - }, - "entrypoints": { - "hashes": [ - "sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", - "sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451" - ], - "version": "==0.3" + "version": "==6.5.0" }, "flake8": { "hashes": [ - "sha256:859996073f341f2670741b51ec1e67a01da142831aa1fdc6242dbf88dffbe661", - "sha256:a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8" + "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db", + "sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248" ], "index": "pypi", - "version": "==3.7.7" + "version": "==5.0.4" }, - "importlib-metadata": { + "iniconfig": { "hashes": [ - "sha256:6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7", - "sha256:cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db" + "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3", + "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32" ], - "version": "==0.18" + "version": "==1.1.1" }, "mccabe": { "hashes": [ - "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", - "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" - ], - "version": "==0.6.1" - }, - "more-itertools": { - "hashes": [ - "sha256:2112d2ca570bb7c3e53ea1a35cd5df42bb0fd10c45f0fb97178679c3c03d64c7", - "sha256:c3e4748ba1aad8dba30a4886b0b1a2004f9a863837b8654e7059eebf727afa5a" + "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325", + "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e" ], - "markers": "python_version > '2.7'", - "version": "==7.0.0" + "markers": "python_version >= '3.6'", + "version": "==0.7.0" }, "packaging": { "hashes": [ - "sha256:0c98a5d0be38ed775798ece1b9727178c4469d9c3b4ada66e8e6b7849f8732af", - "sha256:9e1cbf8c12b1f1ce0bb5344b8d7ecf66a6f8a6e91bcb0c84593ed6d3ab5c4ab3" + "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb", + "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522" ], - "version": "==19.0" + "markers": "python_version >= '3.6'", + "version": "==21.3" }, "pluggy": { "hashes": [ - "sha256:0825a152ac059776623854c1543d65a4ad408eb3d33ee114dff91e57ec6ae6fc", - "sha256:b9817417e95936bf75d85d3f8767f7df6cdde751fc40aed3bb3074cbcb77757c" + "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159", + "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3" ], - "version": "==0.12.0" + "markers": "python_version >= '3.6'", + "version": "==1.0.0" }, "py": { "hashes": [ - "sha256:64f65755aee5b381cea27766a3a147c3f15b9b6b9ac88676de66ba2ae36793fa", - "sha256:dc639b046a6e2cff5bbe40194ad65936d6ba360b52b3c3fe1d08a82dd50b5e53" + "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719", + "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378" ], - "version": "==1.8.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==1.11.0" }, "pycodestyle": { "hashes": [ - "sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56", - "sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c" + "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785", + "sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b" ], - "version": "==2.5.0" + "markers": "python_version >= '3.6'", + "version": "==2.9.1" }, "pyflakes": { "hashes": [ - "sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0", - "sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2" + "sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2", + "sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3" ], - "version": "==2.1.1" + "markers": "python_version >= '3.6'", + "version": "==2.5.0" }, "pyparsing": { "hashes": [ - "sha256:1873c03321fc118f4e9746baf201ff990ceb915f433f23b395f5580d1840cb2a", - "sha256:9b6323ef4ab914af344ba97510e966d64ba91055d6b9afa6b30799340e89cc03" + "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb", + "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc" ], - "version": "==2.4.0" + "markers": "python_full_version >= '3.6.8'", + "version": "==3.0.9" }, "pytest": { "hashes": [ - "sha256:4a784f1d4f2ef198fe9b7aef793e9fa1a3b2f84e822d9b3a64a181293a572d45", - "sha256:926855726d8ae8371803f7b2e6ec0a69953d9c6311fa7c3b6c1b929ff92d27da" + "sha256:1377bda3466d70b55e3f5cecfa55bb7cfcf219c7964629b967c37cf0bda818b7", + "sha256:4f365fec2dff9c1162f834d9f18af1ba13062db0c708bf7b946f8a5c76180c39" ], "index": "pypi", - "version": "==4.6.3" + "version": "==7.1.3" }, "pytest-cov": { "hashes": [ - "sha256:2b097cde81a302e1047331b48cadacf23577e431b61e9c6f49a1170bbe3d3da6", - "sha256:e00ea4fdde970725482f1f35630d12f074e121a23801aabf2ae154ec6bdd343a" + "sha256:2feb1b751d66a8bd934e5edfa2e961d11309dc37b73b0eabe73b5945fee20f6b", + "sha256:996b79efde6433cdbd0088872dbc5fb3ed7fe1578b68cdbba634f14bb8dd0470" ], "index": "pypi", - "version": "==2.7.1" + "version": "==4.0.0" }, "pytest-mock": { "hashes": [ - "sha256:43ce4e9dd5074993e7c021bb1c22cbb5363e612a2b5a76bc6d956775b10758b7", - "sha256:5bf5771b1db93beac965a7347dc81c675ec4090cb841e49d9d34637a25c30568" + "sha256:f4c973eeae0282963eb293eb173ce91b091a79c1334455acfac9ddee8a1c784b", + "sha256:fbbdb085ef7c252a326fd8cdcac0aa3b1333d8811f131bdcc701002e1be7ed4f" ], "index": "pypi", - "version": "==1.10.4" - }, - "six": { - "hashes": [ - "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", - "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" - ], - "version": "==1.12.0" - }, - "wcwidth": { - "hashes": [ - "sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e", - "sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c" - ], - "version": "==0.1.7" + "version": "==3.10.0" }, - "zipp": { + "tomli": { "hashes": [ - "sha256:8c1019c6aad13642199fbe458275ad6a84907634cc9f0989877ccc4a2840139d", - "sha256:ca943a7e809cc12257001ccfb99e3563da9af99d52f261725e96dfe0f9275bc3" + "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", + "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" ], - "version": "==0.5.1" + "version": "==2.0.1" } } } From 9573ed3b536a4b7f8b84aba8200138cc1f1ffcdc Mon Sep 17 00:00:00 2001 From: Carloshbfreire Date: Tue, 18 Oct 2022 16:24:18 -0300 Subject: [PATCH 19/19] Alterado gestor de dependencias para pipenv. close #737 --- Libpythonpro.egg-info/.travis.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Libpythonpro.egg-info/.travis.yml b/Libpythonpro.egg-info/.travis.yml index 28b8e956d..5579cff06 100644 --- a/Libpythonpro.egg-info/.travis.yml +++ b/Libpythonpro.egg-info/.travis.yml @@ -1,14 +1,6 @@ -language: python -python: - - 3.10 - - - 2.7 -install: - - pip install -q pipenv codecov - - pipenv sync --dev -scripts: - - flake8 - - pytest Libpythonpro --cov=Libpythonpro -after_success: - - codecov + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pipenv + pipenv sync -d