# Path: paramiko/py3compat.py
# PY2 = sys.version_info[0] < 3
#         MAXSIZE = int((1 << 31) - 1)  # NOQA
#         MAXSIZE = int((1 << 63) - 1)  # NOQA
#     MAXSIZE = sys.maxsize  # NOQA
#     def bytestring(s):  # NOQA
#     def byte_mask(c, mask):
#     def b(s, encoding="utf8"):  # NOQA
#     def u(s, encoding="utf8"):  # NOQA
#     def b2s(s):
#     def is_callable(c):  # NOQA
#     def get_next(c):  # NOQA
#     def next(c):
#         def __len__(self):
#     def strftime(format, t):
#     def byte_ord(c):
#     def byte_chr(c):
#     def byte_mask(c, mask):
#     def b(s, encoding="utf8"):
#     def u(s, encoding="utf8"):
#     def b2s(s):
#     def is_callable(c):
#     def get_next(c):
#     class X(object):
#     class long(int):


from binascii import hexlify
from paramiko.py3compat import decodebytes
import os
import unittest
import paramiko

    def test_add(self):
        hostdict = paramiko.HostKeys("hostfile.temp")
        hh = "|1|BMsIC6cUIP2zBuXR3t2LRcJYjzM=|hpkJMysjTk/+zzUUzxQEa2ieq6c="
        key = paramiko.RSAKey(data=decodebytes(keyblob))
        hostdict.add(hh, "ssh-rsa", key)
        self.assertEqual(3, len(list(hostdict)))
        x = hostdict["foo.example.com"]
        fp = hexlify(x["ssh-rsa"].get_fingerprint()).upper()
        self.assertEqual(b"7EC91BB336CB6D810B124B1353C32396", fp)
        self.assertTrue(hostdict.check("foo.example.com", key))

    def test_dict(self):
        hostdict = paramiko.HostKeys("hostfile.temp")
        self.assertTrue("secure.example.com" in hostdict)
        self.assertTrue("not.example.com" not in hostdict)
        self.assertTrue("secure.example.com" in hostdict)
        self.assertTrue("not.example.com" not in hostdict)
        x = hostdict.get("secure.example.com", None)
        self.assertTrue(x is not None)
        fp = hexlify(x["ssh-rsa"].get_fingerprint()).upper()
        self.assertEqual(b"E6684DB30E109B67B70FF1DC5C7F1363", fp)
        i = 0
        for key in hostdict:
            i += 1
        self.assertEqual(2, i)

    def test_dict_set(self):
        hostdict = paramiko.HostKeys("hostfile.temp")
        key = paramiko.RSAKey(data=decodebytes(keyblob))

# Path: paramiko/py3compat.py
# PY2 = sys.version_info[0] < 3
#         MAXSIZE = int((1 << 31) - 1)  # NOQA
#         MAXSIZE = int((1 << 63) - 1)  # NOQA
#     MAXSIZE = sys.maxsize  # NOQA
#     def bytestring(s):  # NOQA
#     def byte_mask(c, mask):
#     def b(s, encoding="utf8"):  # NOQA
#     def u(s, encoding="utf8"):  # NOQA
#     def b2s(s):
#     def is_callable(c):  # NOQA
#     def get_next(c):  # NOQA
#     def next(c):
#         def __len__(self):
#     def strftime(format, t):
#     def byte_ord(c):
#     def byte_chr(c):
#     def byte_mask(c, mask):
#     def b(s, encoding="utf8"):
#     def u(s, encoding="utf8"):
#     def b2s(s):
#     def is_callable(c):
#     def get_next(c):
#     class X(object):
#     class long(int):


# Path: tests/test_hostkeys.py
from binascii import hexlify
from paramiko.py3compat import decodebytes
import os
import unittest
import paramiko


    def test_add(self):
        hostdict = paramiko.HostKeys("hostfile.temp")
        hh = "|1|BMsIC6cUIP2zBuXR3t2LRcJYjzM=|hpkJMysjTk/+zzUUzxQEa2ieq6c="
        key = paramiko.RSAKey(data=decodebytes(keyblob))
        hostdict.add(hh, "ssh-rsa", key)
        self.assertEqual(3, len(list(hostdict)))
        x = hostdict["foo.example.com"]
        fp = hexlify(x["ssh-rsa"].get_fingerprint()).upper()
        self.assertEqual(b"7EC91BB336CB6D810B124B1353C32396", fp)
        self.assertTrue(hostdict.check("foo.example.com", key))

    def test_dict(self):
        hostdict = paramiko.HostKeys("hostfile.temp")
        self.assertTrue("secure.example.com" in hostdict)
        self.assertTrue("not.example.com" not in hostdict)
        self.assertTrue("secure.example.com" in hostdict)
        self.assertTrue("not.example.com" not in hostdict)
        x = hostdict.get("secure.example.com", None)
        self.assertTrue(x is not None)
        fp = hexlify(x["ssh-rsa"].get_fingerprint()).upper()
        self.assertEqual(b"E6684DB30E109B67B70FF1DC5C7F1363", fp)
        i = 0
        for key in hostdict:
            i += 1
        self.assertEqual(2, i)

    def test_dict_set(self):
        hostdict = paramiko.HostKeys("hostfile.temp")
        key = paramiko.RSAKey(data=decodebytes(keyblob))

        key_dss = paramiko.DSSKey(data=decodebytes(keyblob_dss))