示例#1
0
文件: test.py 项目: PKpacheco/stone
 def test_retorna_indice_da_tupla_input_erro(self):
     with self.assertRaises(ValueError):
         desafio.retorna_indice_da_tupla_simples(None, 1)
     with self.assertRaises(ValueError):
         desafio.retorna_indice_da_tupla_simples([1, 2, 3], 1)
     with self.assertRaises(ValueError):
         desafio.retorna_indice_da_tupla_simples((), 1)
     with self.assertRaises(ValueError):
         desafio.retorna_indice_da_tupla_simples((1, -2), 1)
     with self.assertRaises(ValueError):
         desafio.retorna_indice_da_tupla_simples((1, 2), -1)
示例#2
0
文件: test.py 项目: PKpacheco/stone
 def test_retorna_indice_da_tupla_com_elemento(self):
     self.assertEquals(2, desafio.retorna_indice_da_tupla_simples((1, 2, 3, 4), 3))
示例#3
0
文件: test.py 项目: PKpacheco/stone
 def test_retorna_indice_da_tupla_menos_1(self):
     self.assertEquals(-1, desafio.retorna_indice_da_tupla_simples((1, 2, 3, 4), 5))