def test_encode(value, string): """Validate that encode() routine accepts various datatypes and encode the values properly """ assert encode(value, use_ebv=True) == string
def test_encode_int__non_ebv_mode(value, width, string): """Validate that encode(value, width=N, use_ebv=False) encodes integer in non-EBV mode with a given width. """ assert encode(value, width=width, use_ebv=False) == string
def _encode(self) -> str: return encode(self.header, width=1) + encode(self.words) + \ encode(self.rn, width=16) + \ encode(self.crc16, width=16)
def _encode(self) -> str: return encode(self.rn, width=16)
def _encode(self) -> str: return encode(self.pc, width=16) + encode(self.epcid) + \ encode(self.crc16, width=16)
def _encode_body(self) -> str: return (encode(self.bank) + encode(self.wordptr, use_ebv=True) + encode(self.wordcnt, width=8) + encode(self.rn, width=16) + encode(self.crc16, width=16))
def _encode_body(self) -> str: return encode(self.rn, width=16) + encode(self.crc16, width=16)
def _encode_body(self) -> str: return encode(self.session)
def _encode_body(self) -> str: return encode(self.dr) + encode(self.m) + encode(self.trext) + \ encode(self.sel) + encode(self.session) + \ encode(self.target) + encode(self.q, width=4) + \ encode(self.crc5, width=5)