Exemplo n.º 1
0
def test_encode(value, string):
    """Validate that encode() routine accepts various datatypes and encode
    the values properly
    """
    assert encode(value, use_ebv=True) == string
Exemplo n.º 2
0
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
Exemplo n.º 3
0
 def _encode(self) -> str:
     return encode(self.header, width=1) + encode(self.words) + \
            encode(self.rn, width=16) + \
            encode(self.crc16, width=16)
Exemplo n.º 4
0
 def _encode(self) -> str:
     return encode(self.rn, width=16)
Exemplo n.º 5
0
 def _encode(self) -> str:
     return encode(self.pc, width=16) + encode(self.epcid) + \
            encode(self.crc16, width=16)
Exemplo n.º 6
0
 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))
Exemplo n.º 7
0
 def _encode_body(self) -> str:
     return encode(self.rn, width=16) + encode(self.crc16, width=16)
Exemplo n.º 8
0
 def _encode_body(self) -> str:
     return encode(self.session)
Exemplo n.º 9
0
 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)