Open
Conversation
Collaborator
mayaracsferreira
left a comment
There was a problem hiding this comment.
Olá, Sofia!
Sua lógica está indo no caminho certissimo, vc demonstra que compreendeu a entrega e como montar a lógica para testar porém tem alguns ajustes para serem feitos:
- Juntar as classes Biblioteca() numa só com os métodos init, adicionar_livro, exibir_livros, emprestar_livro
- Juntar os testes dentro de uma classe de teste, utilizando o unittest e os asserts do framework, não a keyword assert
|
|
||
| test_exibir_livros() | ||
|
|
||
| class Biblioteca: |
Collaborator
There was a problem hiding this comment.
A classe Biblioteca está duplicada no arquivo, o código dessa classe podem se juntar ao da classe Biblioteca na linha 1
| if livro['nome'] == nome_livro: | ||
| livro['esta_emprestado'] = True | ||
|
|
||
| def test_emprestar_livro(): |
Collaborator
There was a problem hiding this comment.
A lógica dos testes está num caminho muito bom!! Parabéns!
porém aqui vc está usando a função assert que é utilizada para debug de código e não o assert do framework de teste unittest .
Veja a classe de testbiblioteca que fizemos em sala de aula como exemplo.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.