(self)
| 9 | |
| 10 | class BinaryTestCase(unittest.TestCase): |
| 11 | def test_basic(self): |
| 12 | wire = bytes.fromhex("0102010203040102") |
| 13 | p = dns.wire.Parser(wire) |
| 14 | self.assertEqual(p.get_uint16(), 0x0102) |
| 15 | with p.restrict_to(5): |
| 16 | self.assertEqual(p.get_uint32(), 0x01020304) |
| 17 | self.assertEqual(p.get_uint8(), 0x01) |
| 18 | self.assertEqual(p.remaining(), 0) |
| 19 | with self.assertRaises(dns.exception.FormError): |
| 20 | p.get_uint16() |
| 21 | self.assertEqual(p.remaining(), 1) |
| 22 | self.assertEqual(p.get_uint8(), 0x02) |
| 23 | with self.assertRaises(dns.exception.FormError): |
| 24 | p.get_uint8() |
| 25 | |
| 26 | def test_name(self): |
| 27 | # www.dnspython.org NS IN question |
nothing calls this directly
no test coverage detected