5Xc@sdZddlmZddlZejeZddlmZm Z ddl m Z ddl mZdefdYZdS( stest passlib.hostsi(twith_statementN(thoststhash(tunix_crypt_schemes(tTestCaset HostsTestcBs2eZdZdZdZdZdZRS(s0perform general tests to make sure contexts workcCsSxLddddgD]8}|j|j|d|j|jd|qWdS(Ntt!t*s#!$1$TXl/FX/U$BZge.lr.ux6ekjEjxmzwz0t unix_disabledttest(t assertEqualtidentifyt assertFalsetverify(tselftctxR((s</usr/lib/python2.7/site-packages/passlib/tests/test_hosts.pytcheck_unix_disableds cCsPtj}x3ddddgD]}|j|jd|qW|j|dS(Nsw$6$rounds=41128$VoQLvDjkaZ6L6BIE$4pt.1Ll1XdDYduEwEYPCMOBiR6W6znsyUEoNlcVXpv2gKKIbQolgmTGe6uEEVJ7azUxuc8Tf7zV9SD2z7Ij751sL$5$rounds=31817$iZGmlyBQ99JSB5n6$p4E.pdPBWx19OajgjLRiOW0itGnyxDGgMlDcOsfaI17s"$1$TXl/FX/U$BZge.lr.ux6ekjEjxmzwz0s kAJJz.Rwp0A/IR (Rt linux_contextt assertTrueRR(RRR((s</usr/lib/python2.7/site-packages/passlib/tests/test_hosts.pyttest_linux_context%s  cCsxtjtjtjgD]}x-ddgD]}|j|jd|q,Wd}tjjr|j|jd|n|j |j |d|j |qWdS(Ns"$1$TXl/FX/U$BZge.lr.ux6ekjEjxmzwz0s kAJJz.Rwp0A/IR s<$2a$04$yjDgE74RJkeqC0/1NheSSOrvKeu9IbKDpcQf/Ox3qsrRS/Kw42qIStbcrypt( Rtfreebsd_contexttopenbsd_contexttnetbsd_contextRRthashmodRt has_backendR R R(RRRth1((s</usr/lib/python2.7/site-packages/passlib/tests/test_hosts.pyttest_bsd_contexts2s cCsttdd}|s%|jdSt|j}|j|d|jd|k|jd|j|d|jtt j ||j |xHddddgD]4\}}||kr|j|j d|qqWdS(Nt host_contexts+host_context not available on this platformsBappears to be unix system, but no known schemes supported by cryptR s*should have schemes beside fallback schemet sha512_cryptsw$6$rounds=41128$VoQLvDjkaZ6L6BIE$4pt.1Ll1XdDYduEwEYPCMOBiR6W6znsyUEoNlcVXpv2gKKIbQolgmTGe6uEEVJ7azUxuc8Tf7zV9SD2z7Ij751t sha256_cryptsL$5$rounds=31817$iZGmlyBQ99JSB5n6$p4E.pdPBWx19OajgjLRiOW0itGnyxDGgMlDcOsfaI17t md5_crypts"$1$TXl/FX/U$BZge.lr.ux6ekjEjxmzwz0t des_crypts kAJJz.Rwp0A/IR (Rsw$6$rounds=41128$VoQLvDjkaZ6L6BIE$4pt.1Ll1XdDYduEwEYPCMOBiR6W6znsyUEoNlcVXpv2gKKIbQolgmTGe6uEEVJ7azUxuc8Tf7zV9SD2z7Ij751(RsL$5$rounds=31817$iZGmlyBQ99JSB5n6$p4E.pdPBWx19OajgjLRiOW0itGnyxDGgMlDcOsfaI17(R s"$1$TXl/FX/U$BZge.lr.ux6ekjEjxmzwz0(R!s kAJJz.Rwp0A/I( tgetattrRtNonetskipTesttlisttschemesRtremovetsetRt issupersetRR(RRR&tschemeR((s</usr/lib/python2.7/site-packages/passlib/tests/test_hosts.pyttest_host_contextDs"    (t__name__t __module__t__doc__RRRR+(((s</usr/lib/python2.7/site-packages/passlib/tests/test_hosts.pyRs  (R.t __future__Rtloggingt getLoggerR,tlogtpasslibRRRt passlib.utilsRtpasslib.tests.utilsRR(((s</usr/lib/python2.7/site-packages/passlib/tests/test_hosts.pyts