Exemplo n.º 1
0
 def test_naoDeveAceitarDesempacotar(self):
     pacote = PacoteInformacao("qwe")
     
     with self.assertRaises(InformacaoException):
         InformacaoTipoValor(byteArray=pacote.toByteArray())
Exemplo n.º 2
0
 def test_deveEmpacotarEDesempacotar(self):
     string, inteiro, flutuante = "Teste", 1, 1.2
     p1 = PacoteInformacao(string)
     p2 = PacoteInformacao(inteiro)
     p3 = PacoteInformacao(flutuante)
 
     pg1 = PacoteInformacao(byteArray=p1.toByteArray())
     pg2 = PacoteInformacao(byteArray=p2.toByteArray())
     pg3 = PacoteInformacao(byteArray=p3.toByteArray())
 
     self.assertEqual(pg1.getValor(), string)
     self.assertEqual(pg2.getValor(), inteiro)
     self.assertEqual(pg3.getValor(), flutuante)