def test_escrita_campo_num_int(self):
        # aceitar somente inteiros (int e long)
        with self.assertRaises(errors.TipoError):
            self.header_arquivo.controle_banco = 10.0
        with self.assertRaises(errors.TipoError):
            self.header_arquivo.controle_banco = ''

        # verifica se o numero de digitos esta sendo verificado
        with self.assertRaises(errors.NumDigitosExcedidoError):
            self.header_arquivo.controle_banco = 12345678234567890234567890
        with self.assertRaises(errors.NumDigitosExcedidoError):
            self.header_arquivo.controle_banco = 1234

        # verifica valor armazenado
        self.header_arquivo.controle_banco = 5
        self.assertEqual(self.header_arquivo.controle_banco, 5)
def setUp(self):
        entry_Li = ComputedEntry("Li", -1.90753119)

        with open(os.path.join(PymatgenTest.TEST_FILES_DIR, "LiTiO2_batt.json")) as f:
            entries_LTO = json.load(f, cls=MontyDecoder)
            self.ie_LTO = InsertionElectrode.from_entries(entries_LTO, entry_Li)

        with open(os.path.join(PymatgenTest.TEST_FILES_DIR, "FeF3_batt.json")) as fid:
            entries = json.load(fid, cls=MontyDecoder)
            self.ce_FF = ConversionElectrode.from_composition_and_entries(Composition("FeF3"), entries)