# Path: libagent/device/interface.py
# def string_to_identity(identity_str):
# def identity_to_string(identity_dict):
#     def __init__(self, identity_str, curve_name):
#     def items(self):
#     def to_bytes(self):
#     def to_string(self):
#     def get_bip32_address(self, ecdh=False):
#     def get_curve_name(self, ecdh=False):
#     def __init__(self):
#     def connect(self):
#     def close(self):
#     def __enter__(self):
#     def __exit__(self, *args):
#     def pubkey(self, identity, ecdh=False):
#     def sign(self, identity, blob):
#     def ecdh(self, identity, pubkey):
#     def __str__(self):
# class Error(Exception):
# class NotFoundError(Error):
# class DeviceError(Error):
# class Identity:
# class Device:


from ..device import interface


def test_unicode():
    i = interface.Identity('ko\u017eu\u0161\u010dek@host', 'ed25519')
    assert i.to_bytes() == b'kozuscek@host'

# Path: libagent/device/interface.py
# def string_to_identity(identity_str):
# def identity_to_string(identity_dict):
#     def __init__(self, identity_str, curve_name):
#     def items(self):
#     def to_bytes(self):
#     def to_string(self):
#     def get_bip32_address(self, ecdh=False):
#     def get_curve_name(self, ecdh=False):
#     def __init__(self):
#     def connect(self):
#     def close(self):
#     def __enter__(self):
#     def __exit__(self, *args):
#     def pubkey(self, identity, ecdh=False):
#     def sign(self, identity, blob):
#     def ecdh(self, identity, pubkey):
#     def __str__(self):
# class Error(Exception):
# class NotFoundError(Error):
# class DeviceError(Error):
# class Identity:
# class Device:


# Path: libagent/tests/test_interface.py
from ..device import interface



def test_unicode():
    i = interface.Identity('ko\u017eu\u0161\u010dek@host', 'ed25519')
    assert i.to_bytes() == b'kozuscek@host'

    assert sorted(i.items()) == [('host', 'host'), ('user', 'kozuscek')]