Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Criar classes de exception #56

Closed
itepifanio opened this issue Aug 9, 2019 · 5 comments
Closed

Criar classes de exception #56

itepifanio opened this issue Aug 9, 2019 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Issues simples para o evento hacktoberfest

Comments

@itepifanio
Copy link
Member

itepifanio commented Aug 9, 2019

Feature

Hoje tratamos as exceptions de forma bem geral, porém poderíamos criar classes de exceção para nos auxiliarmos a lidar com os erros. Isso ajuda bastante nos testes, tornando-os mais assertivos, visto que o unittest tem a função assertRaises()

Participe do Hacktoberfest!

Contribua com uma issue com a label hacktoberfest e abra um pull request durante o mês de outubro para ganhar os brindes do GitHub! Para se inscrever, acesse https://hacktoberfest.digitalocean.com/register

@itepifanio itepifanio added the enhancement New feature or request label Aug 9, 2019
@itepifanio itepifanio changed the title Criar classe de exception Criar classes de exception Aug 9, 2019
@itepifanio itepifanio added this to the Versão 1.0.0 -> 2.0.0 milestone Aug 9, 2019
@alvarofpp alvarofpp mentioned this issue Aug 27, 2019
4 tasks
@diegodiogenes diegodiogenes added the hacktoberfest Issues simples para o evento hacktoberfest label Sep 28, 2019
@nymarya nymarya added the good first issue Good for newcomers label Sep 28, 2019
@suv27
Copy link
Contributor

suv27 commented Oct 5, 2019

Me puedes dar un pouito mas de explicacion de lo que necesitas? Puedo ayudar agregar mas unittest solamente necitatere que me encamines a los files que lo necesitan

@itepifanio
Copy link
Member Author

itepifanio commented Oct 5, 2019

Hola, @Physsix27

No enumeramos todas las exceptions que queremos escribir, pero tenemos un ejemplo. En el test_file tenemos la function test_can_print_exception_download_packages_from_file pero no tenemos esta exception, solo printamos como self._print_exception(ex) en la class File.

Se tenemos la custom exception podriamos escribir raise CustomException y entonces ir a los tests y escribir assertRaises(CustomException)
Si tu puderes escribir una exception initial como esta descrita, entonces ayudaría mucho.

@suv27
Copy link
Contributor

suv27 commented Oct 5, 2019

Ok, deja ver si entiendo, quieres que escriba un custom CustonException pata poder usarla en self._print_exception(CustonException) y luego poder usarla en el test? si eso es lo que quieres puedo ayudar.

Mi Idioma: Espanol

@suv27
Copy link
Contributor

suv27 commented Oct 5, 2019

Puedes darme una descripcion de lo que hara el custonexception cuando tenga esa description puedo poner el PR. ya casi termino

suv27 added a commit to suv27/odufrn-downloader that referenced this issue Oct 5, 2019
suv27 added a commit to suv27/odufrn-downloader that referenced this issue Oct 5, 2019
@suv27 suv27 mentioned this issue Oct 5, 2019
1 task
suv27 added a commit to suv27/odufrn-downloader that referenced this issue Oct 5, 2019
suv27 added a commit to suv27/odufrn-downloader that referenced this issue Oct 5, 2019
@suv27
Copy link
Contributor

suv27 commented Oct 7, 2019

Hey @itepifanio dejame saber si necesito cambiar algo de mi PR para poder darle merged. Ya esta completo.

PR #95

suv27 added a commit to suv27/odufrn-downloader that referenced this issue Oct 7, 2019
suv27 added a commit to suv27/odufrn-downloader that referenced this issue Oct 7, 2019
suv27 added a commit to suv27/odufrn-downloader that referenced this issue Oct 8, 2019
suv27 added a commit to suv27/odufrn-downloader that referenced this issue Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Issues simples para o evento hacktoberfest
Projects
None yet
Development

No branches or pull requests

4 participants