Guest User

Untitled

a guest
Feb 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.03 KB | None | 0 0
  1. import unittest
  2.  
  3. def jokempo(x, y):
  4.     if (x, y) == ("pedra", "tesoura"):
  5.         return "pedra"
  6.     elif (x, y) == ("tesoura", "pedra"):
  7.         return "pedra"
  8.     elif (x, y) == ("tesoura", "papel"):
  9.         return x
  10.     elif (x, y) == ("papel", "tesoura"):
  11.         return "tesoura"
  12.     elif (x, y) == ("pedra", "papel"):
  13.         return "papel"
  14.     elif (x, y) == ("papel", "pedra"):
  15.         return "papel"
  16.  
  17.        
  18. class TestCase(unittest.TestCase):
  19.    
  20.     def teste_pedra_tesoura (self):
  21.         self.assertEquals(jokempo("pedra", "tesoura"), "pedra")
  22.  
  23.     def teste_tesoura_pedra (self):
  24.         self.assertEquals(jokempo("tesoura", "pedra"), "pedra")
  25.  
  26.     def teste_papel_tesoura (self):
  27.         self.assertEquals(jokempo("papel", "tesoura"), "tesoura")
  28.  
  29.     def teste_tesoura_papel (self):
  30.         self.assertEquals(jokempo("tesoura", "papel"), "tesoura")
  31.        
  32.     def teste_papel_pedra (self):
  33.         self.assertEquals(jokempo("papel", "pedra"), "papel")
Add Comment
Please, Sign In to add comment