From 175ba6551cc099aeb5e543669d608c717b011cc0 Mon Sep 17 00:00:00 2001 From: Dustin Rodrigues Date: Sun, 19 Mar 2017 15:13:29 -0400 Subject: [PATCH] add pim tests --- dpkt/pim.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dpkt/pim.py b/dpkt/pim.py index 3753da6..629ae86 100644 --- a/dpkt/pim.py +++ b/dpkt/pim.py @@ -58,3 +58,13 @@ class PIM(dpkt.Packet): if not self.sum: self.sum = dpkt.in_cksum(dpkt.Packet.__bytes__(self)) return dpkt.Packet.__bytes__(self) + +def test_pim(): + pimdata = PIM(b'\x20\x00\x9f\xf4\x00\x01\x00\x02\x00\x69') + assert pimdata.v == 2 + assert pimdata.type == 0 + + # test setters + pimdata.v = 3 + pimdata.type = 1 + assert bytes(pimdata) == b'\x31\x00\x9f\xf4\x00\x01\x00\x02\x00\x69'