# Path: zorro/mongodb/bson.py
# class ObjectID(bytes):
#     def __repr__(self):
# def _unpack(char):
#     def register(fun):
# def _pack(char, typ):
#     def register(fun):
# def unpack_float(buf, idx):
# def unpack_string(buf, idx):
# def unpack_document(buf, idx):
# def unpack_array(buf, idx):
# def unpack_objectid(buf, idx):
# def unpack_none(buf, idx):
# def unpack_int32(buf, idx):
# def unpack_int64(buf, idx):
# def loads(s):
# def iter_load_from(buf, offset=0):
# def pack_float(value, buf):
# def pack_string(value, buf):
# def pack_document(value, buf):
# def pack_array(value, buf):
# def pack_objectid(value, buf):
# def pack_none(value, buf):
# def pack_int(value, buf):
# def _pack_doc(pairs, buf):
# def dumps(obj):
# def dump_extend(buf, obj):
# def dump_extend_iter(buf, iterable):


import unittest
from zorro.mongodb import bson



class TestBson(unittest.TestCase):

    def test_loads(self):
        data = b"\x16\x00\x00\x00\x02hello\x00\x06\x00\x00\x00world\x00\x00"

# Path: zorro/mongodb/bson.py
# class ObjectID(bytes):
#     def __repr__(self):
# def _unpack(char):
#     def register(fun):
# def _pack(char, typ):
#     def register(fun):
# def unpack_float(buf, idx):
# def unpack_string(buf, idx):
# def unpack_document(buf, idx):
# def unpack_array(buf, idx):
# def unpack_objectid(buf, idx):
# def unpack_none(buf, idx):
# def unpack_int32(buf, idx):
# def unpack_int64(buf, idx):
# def loads(s):
# def iter_load_from(buf, offset=0):
# def pack_float(value, buf):
# def pack_string(value, buf):
# def pack_document(value, buf):
# def pack_array(value, buf):
# def pack_objectid(value, buf):
# def pack_none(value, buf):
# def pack_int(value, buf):
# def _pack_doc(pairs, buf):
# def dumps(obj):
# def dump_extend(buf, obj):
# def dump_extend_iter(buf, iterable):


# Path: tests/test_bson.py
import unittest
from zorro.mongodb import bson




class TestBson(unittest.TestCase):

    def test_loads(self):
        data = b"\x16\x00\x00\x00\x02hello\x00\x06\x00\x00\x00world\x00\x00"

        self.assertEqual({"hello": "world"}, bson.loads(data))