How to use the quarry.types.uuid.UUID.from_bytes function in quarry

To help you get started, we’ve selected a few quarry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github barneygale / quarry / tests / types / test_buffer.py View on Github external
]
entity_metadata_vectors = [
    (OrderedDict((
        ((0, 0), 0),
        ((1, 1), 1),
        ((2, 2), 2.0),
        ((3, 3), u'three'),
        ((4, 4), Message({'text': u'four'})),
        ((5, 5), Message({'text': u'five'})),
        ((6, 6), {'count': 1, 'item': 267, 'tag': TagRoot({})}),
        ((7, 7), True),
        ((8, 8), (8, 8, 8)),
        ((9, 9), (9, 9, 9)),
        ((10, 10), (10, 10, 10)),
        ((11, 11), 'north'),
        ((12, 12), UUID.from_bytes(uuid_vector)),
        ((13, 13), 13),
        ((14, 14), TagRoot({u'foo': TagString(u'bar')})))),

        b'\x00\x00\x00'
        b'\x01\x01\x01'
        b'\x02\x02\x40\x00\x00\x00'
        b'\x03\x03\x05three'
        b'\x04\x04\x10{"text": "four"}'
        b'\x05\x05\x01\x10{"text": "five"}'
        b'\x06\x06\x01\x8b\x02\x01\x00'
        b'\x07\x07\x01'
        b'\x08\x08\x41\x00\x00\x00\x41\x00\x00\x00\x41\x00\x00\x00'
        b'\x09\x09\x00\x00\x02\x40\x00\x00\x90\x09'
        b'\x0a\x0a\x01\x00\x00\x02\x80\x00\x00\xa0\x0a'
        b'\x0b\x0b\x02'
        b'\x0c\x0c\x01' + uuid_vector +
github barneygale / quarry / tests / types / test_buffer.py View on Github external
def test_pack_uuid():
    assert Buffer.pack_uuid(UUID.from_bytes(uuid_vector)) == uuid_vector
github barneygale / quarry / tests / types / test_types.py View on Github external
def test_uuid_from_bytes_to_hex():
    uuid = UUID.from_bytes(bytes_vector)
    assert isinstance(uuid, UUID)
    assert uuid.to_hex() == hex_vector
    assert uuid.to_hex(False) == hex_vector.replace("-", "")
github barneygale / quarry / quarry / types / buffer / v1_7.py View on Github external
def unpack_uuid(self):
        """
        Unpacks a UUID.
        """

        return UUID.from_bytes(self.read(16))
github barneygale / quarry / quarry / types / buffer / v1_7.py View on Github external
def unpack_uuid(self):
        """
        Unpacks a UUID.
        """

        return UUID.from_bytes(self.read(16))