Пример #1
0
 def test_cria_cabecalho_com_origem_e_destino_11_para_10(self):
     cabecalho = cria_cabecalho(origem='11', destino='10')
     self.assertEqual(cabecalho, ['0', '0', '0', '0', '1', '1', '1', '0'])
Пример #2
0
 def test_a_string_de_destino_deve_conter_dois_caracteres_0_e_1(self):
     with self.assertRaises(ValueError) as context_manager:
         cria_cabecalho(origem='01', destino='1010101')
     exception = context_manager.exception
     self.assertEquals(str(exception),
                       'Destino deve conter dois caracteres')
Пример #3
0
 def test_a_string_de_destino_deve_conter_binario(self):
     with self.assertRaises(ValueError) as context_manager:
         cria_cabecalho(origem='11', destino='qw')
     exception = context_manager.exception
     self.assertEquals(str(exception),
                       'Destino deve conter binario')
Пример #4
0
 def test_caso_destino_nao_seja_string_deve_subir_ValueError(self):
     with self.assertRaises(TypeError) as context_manager:
         cria_cabecalho(origem='10', destino=2)
     exception = context_manager.exception
     self.assertEquals(str(exception), 'Destino deve ser uma string')