Created
October 27, 2010 12:29
-
-
Save nati57/648935 to your computer and use it in GitHub Desktop.
This file contains 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
#@author Rafael Salomao <rafaelgavazzi at gmail.com> | |
#@author Natalia Marcondes < natalia.marcondes at gmail.com> | |
#@author Luciana Mendes <super.luci at gmail.com> | |
#@author Carlos Eduardo <kaddxxi at gmail.com> | |
#@author Patricia Carvalho <patfcarv at gmail.com> | |
class Reprovado: | |
def retorna_menor(self, aluno, nota): | |
nota_menor = min(nota) | |
index_menor = nota.index(nota_menor) | |
nome_menor = aluno[index_menor] | |
return nome_menor | |
retorna_menor = classmethod(retorna_menor) |
This file contains 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
#@author Rafael Salomao <rafaelgavazzi at gmail.com> | |
#@author Natalia Marcondes < natalia.marcondes at gmail.com> | |
#@author Luciana Mendes <super.luci at gmail.com> | |
#@author Carlos Eduardo <kaddxxi at gmail.com> | |
#@author Patricia Carvalho <patfcarv at gmail.com> | |
from array import array | |
import unittest | |
from Reprovado import Reprovado | |
class Reprovado_TestCase(unittest.TestCase): | |
def test_entra_2_participante(self): | |
aluno = ["rafael", "natalia"] | |
nota = [10,3] | |
participante = Reprovado.retorna_menor(aluno, nota) | |
self.assertEqual("natalia",participante) | |
def test_entra_3_participante(self): | |
aluno = ["rafael", "natalia", "marco"] | |
nota = [10,3,3] | |
participante = Reprovado.retorna_menor(aluno, nota) | |
self.assertEqual("marco",participante) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment