def test_maxwidth_setter(self): parser = AddressParser() parser.maxwidth = 24 self.assertEqual(24, parser.maxwidth) self.assertEqual(0xFFFFFF, parser._maxaddr)
def test_number_constrains_address_at_maxwidth_24(self): parser = AddressParser() parser.maxwidth = 24 parser.labels = {'foo': 0xFFFFFF} self.assertRaises(OverflowError, parser.number, 'foo+5')