403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/keyring/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyc
ó
;€ªPc@s—dZddlZddlZddlZddlZddlZddlZddlZddlZyddl	Z
Wnek
r•ddl
Z
nXddlZ
ejejZejejZdefd„ƒYZejd„ƒZd„Zd„Zed„Zd	„Zd
„Zd„Zd„Zd
„Zd„Z d„Z!d„Z"defd„ƒYZ#e
j$eƒdƒde#e
j%fd„ƒYƒZ&e
j$eƒdƒde#e
j%fd„ƒYƒZ'e
j$eƒdƒde#e
j%fd„ƒYƒZ(defd„ƒYZ)defd„ƒYZ*d e
j%fd!„ƒYZ+e
j$eƒoSe ƒd"ƒd#e
j%fd$„ƒYƒZ,d%e#fd&„ƒYZ-d'e-e
j%fd(„ƒYZ.e
j$eƒd)ƒd*e-e
j%fd+„ƒYƒZ/e
j$eƒd,ƒd-e-e
j%fd.„ƒYƒZ0e
j$e!ƒd/ƒd0e#e
j%fd1„ƒYƒZ1e
j$e"ƒd2ƒd3e#e
j%fd4„ƒYƒZ2d5„Z3e4d6kr“e
j5d7d8ƒndS(9sY
test_backend.py

Test case for keyring basic function

created by Kang Zhang 2009-07-14
iÿÿÿÿNtImportKillercBs>eZdZd„Zdd„Zd„Zd„Zd„ZRS(s@Context manager to make an import of a given name or names fail.cGs
||_dS(N(tnames(tselfR((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyt__init__scCs||jkr|SdS(N(R(Rtfullnametpath((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytfind_module!scCs%||jkst‚t|ƒ‚dS(N(RtAssertionErrortImportError(RR((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytload_module$scCsMi|_x-|jD]"}tjj|dƒ|j|<qWtjj|ƒdS(N(toriginalRtsystmodulestpoptNonet	meta_pathtappend(Rtname((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyt	__enter__'s	 cGsPtjj|ƒx9|jjƒD](\}}|dk	r |tj|<q q WdS(N(RRtremoveR
titemsRR(Rtargstkeytvalue((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyt__exit__,sN(	t__name__t
__module__t__doc__RRRR	RR(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRs			cksºi}x\|jƒD]N\}}|j|ƒ||<|dkrW||kra||=qaq|||<qWdVxI|jƒD];\}}|dkr¨||kr²||=q²qw|||<qwWdS(s¯Helper context manager to make and unmake changes to a dict.

    A None is not a valid value for the destination, and so means that the
    associated name should be removed.N(RtgetR(tdestinationtchangesR
RR((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytNoNoneDictMutator3s

cKsttj|S(s6A context manager to temporarily change the os.environ(Rtostenviron(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytEnvironJscOs4x!|D]}tj|ƒ||<qWttj|S(sDA context manager to temporarily make it possible to import a module(ttypest
ModuleTypeRRR(RRR((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyt
ImportBlesserOs
cCs7d}x*td|ƒD]}|tj|ƒ7}qW|S(s2Generate a random string with length <i>k</i>
    ti(trangetrandomtchoice(tktsourcetresultti((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyt
random_stringVscCsFytdƒWntk
r"tSXtjdkoEtjƒddkS(Nskeyring.backends.win32_cryptotwin32iþÿÿÿi(swin32(t
__import__RtFalseRtplatformtgetwindowsversion(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytis_win32_crypto_supported_s

cCs
tjdkS(Ntmactdarwin(R5sdarwin(RR2(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytis_osx_keychain_supportedfscCs)tjjƒjƒ}|dkr%tStS(Niÿÿÿÿ(tkeyringtbackendt
KDEKWallett	supportedR1tTrue(R;((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytis_kwallet_supportediscCs;y"tdƒtdƒtdƒWntk
r6tSXtS(NsCrypto.Cipher.AESsCrypto.Protocol.KDFs
Crypto.Random(R0RR1R<(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytis_crypto_supportedos


cCs)tjjƒjƒ}|dkr%tStS(Niÿÿÿÿ(R8R9tGnomeKeyringR;R1R<(R;((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytis_gnomekeyring_supportedxscCs'ytdƒWntk
r"tSXtS(NsPyQt4.QtGui(R0RR1R<(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytis_qt4_supported~s

cCsVytdƒt}Wntk
r-t}nXtjdkoUtjƒjdkoU|S(Nt	win32credR/i(swin32(R0R<RR1RR2R3tmajor(thas_pywin32((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytis_winvault_supported…s



$cCs'ytdƒWntk
r"tSXtS(Ntdbus(R0RR1R<(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytis_dbus_supporteds

tBackendBasicTestscBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(sITest for the keyring's basic funtions. password_set and password_get
    cCs|jƒ|_tƒ|_dS(N(tinit_keyringR8tsettcredentials_created(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytsetUp›scCs0|jj|||ƒ|jj||fƒdS(N(R8tset_passwordRKtadd(Rtservicetusernametpassword((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRMŸscCs‡|j}|j|j||ƒdƒ|j|||ƒ|j|j||ƒ|ƒ|j||dƒ|j|j||ƒdƒdS(NR&(R8tassertEqualtget_passwordRRM(RRORPRQR8((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyt
check_set_get¥s	cCs;tdƒ}tdƒ}tdƒ}|j|||ƒdS(Ni(R.RT(RRQRPRO((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyttest_password_set_get³scCsDtdtƒ}tdtƒ}tdtƒ}|j|||ƒdS(Ni(R.tDIFFICULT_CHARSRT(RRQRPRO((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyttest_difficult_chars¹scCsš|j}|jdddƒ|jdddƒ|j|jddƒdƒ|j|jddƒdƒ|jdddƒ|j|jddƒdƒd	S(
s¥
        Issue #47 reports that WinVault isn't storing passwords for
        multiple users. This test exercises that test for each of the
        backends.
        tservice1tuser1t	password1tuser2t	password2tservice2tuser3t	password3N(R8RMRRRS(RR8((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyttest_different_user¿s	(	RRRRLRMRTRURWR`(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRH—s					s	Need OS XtOSXKeychainTestCasecBseZd„ZRS(cCs
tjjƒS(N(R8R9tOSXKeychain(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRIÕs(RRRI(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRaÑssNeed GnomeKeyringtGnomeKeyringTestCasecBsGeZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCstddddddƒS(NtGNOME_KEYRING_CONTROLt1tDISPLAYtDBUS_SESSION_BUS_ADDRESS(tdict(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyR!ÝscCstjjƒ}d|_|S(Ntsession(R8R9R?tKEYRING_NAME(RR*((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRIâs	cCsItdƒ7t|jƒ|jd|jjƒƒWdQXWdQXdS(Ntgnomekeyringi(R%R"R!RRR8R;(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyttest_supportedës
cCsItdƒ7t|jƒ|jd|jjƒƒWdQXWdQXdS(NRkiÿÿÿÿ(RR"R!RRR8R;(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyttest_supported_no_moduleðs
cCsYtdƒG|jƒ}d|d<t||jd|jjƒƒWdQXWdQXdS(NRkRdi(R%R!RR"RRR8R;(RR!((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyttest_supported_no_keyringõs



cCsYtdƒG|jƒ}d|d<t||jd|jjƒƒWdQXWdQXdS(NRkRfi(R%R!RR"RRR8R;(RR!((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyttest_supported_no_displayüs



cCsYtdƒG|jƒ}d|d<t||jd|jjƒƒWdQXWdQXdS(NRkRgi(R%R!RR"RRR8R;(RR!((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyttest_supported_no_sessions



(	RRR!RIRlRmRnRoRp(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRcÙs							sNeed KWallettKDEKWalletTestCasecBseZd„ZRS(cCs
tjjƒS(N(R8R9R:(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRIs(RRRI(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRqstUnOpenableKWalletcBs&eZdZdZd„Zd„ZRS(s7A module-like object used to test KDE wallet fall-back.cGsdS(N(R(RR((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyt
openWalletscCsdS(N(R(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyt
NetworkWalletsN(RRRRtSynchronousRsRt(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRrs	t	FauxQtGuicBsMeZdZddd„ƒYZdefd„ƒYZdefd„ƒYZRS(sDA fake module-like object used in testing the open_kwallet function.tqAppcBseZed„ƒZRS(cCsdS(N((((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytinstance#s(RRtstaticmethodRx(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRw"stQApplicationcBseZd„Zd„ZRS(cGsdS(N((RR((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyR(scCsdS(N((R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytexit+s(RRRR{(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRz's	tQWidgetcBseZd„Zd„ZRS(cGsdS(N((RR((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyR/scCsdS(N((R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pytwinId2s(RRRR}(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyR|.s	((RRRRwtobjectRzR|(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRvstKDEWalletCanceledTestCasecBseZd„ZRS(cCs)|jtjjtƒtƒƒdƒdS(N(RRR8R9topen_kwalletRrRvR(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyttest_user_canceled7s(RRR(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyR5ssNeed KWallet and Qt4tKDEKWalletInQApplicationcBseZd„ZRS(cCsy$ddlm}ddlm}WndSX|gƒ}tjjƒ}|jt||j	ƒddt
|ƒƒ|jƒdS(Niÿÿÿÿ(tKWallet(Rztmsgs?The object wallet should be type <KWallet.Wallet> but it is: %s(tPyKDE4.kdeuiRƒtPyQt4.QtGuiRzR8R9R€t
assertTruet
isinstancetWallettreprR{(RRƒRztapptwallet((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyttest_QApplicationFs(RRR(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyR‚BstFileKeyringTestscBs#eZd„Zd„Zd„ZRS(cCsNtt|ƒjƒ|jƒ|_tjjtj	ƒdƒ|j_
|_dS(Ns
test_pass.cfg(tsuperRŽRLRIR8R Rtjointtempfiletmkdtempt	file_pathttmp_keyring_file(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRLWs	cCsCytj|jƒWn(tk
r>}|jdkr?‚q?nXdS(Ni(R tunlinkR”tOSErrorterrno(Rte((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyttearDown]s
cCsMtdƒ}|jdƒ}|jj|ƒ}|j||jj|ƒƒdS(Nisutf-8(R.tencodeR8tencryptRRtdecrypt(RRQt	encrypted((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyttest_encrypt_decryptds(RRRLR™Rž(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRŽUs		tUncryptedFileKeyringTestCasecBseZd„ZRS(cCs
tjjƒS(N(R8R9tUncryptedFileKeyring(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRIos(RRRI(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRŸmssNeed Crypto moduletCryptedFileKeyringTestCasecBs#eZd„Zd„Zd„ZRS(cCs2t|j|ƒjƒtj|_d„t_dS(Nc_sdS(Ntabcdef((Rtkwargs((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyt<lambda>{s(Rt	__class__RLtgetpasstgetpass_orig(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRLwscCs|jt_|`dS(N(R§R¦(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyR™}scCs
tjjƒS(N(R8R9tCryptedFileKeyring(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRIs(RRRLR™RI(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyR¡ss		sNeed WindowstWin32CryptoKeyringTestCasecBseZd„ZRS(cCs
tjjƒS(N(R8R9tWin32CryptoKeyring(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRI‰s(RRRI(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyR©…ss
Need WinVaulttWinVaultKeyringTestCasecBseZd„Zd„ZRS(cCsOxH|jD]=}y|jj|ŒWq
tk
rF}tj|IJq
Xq
WdS(N(RKR8tdelete_passwordt	ExceptionRtstderr(RtcredR˜((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyR™s
cCs
tjjƒS(N(R8R9tWinVaultKeyring(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRI˜s(RRR™RI(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyR«s	s$DBus needed for SecretServiceKeyringtSecretServiceKeyringTestCasecBs)eZeZd„Zd„Zd„ZRS(cCstddddƒS(NRfReRg(Rh(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyR! scCstjdIJtjjƒS(NsMTesting SecretServiceKeyring, following password prompts are for this keyring(RR®R8R9tSecretServiceKeyring(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRI¤s
cCsItdƒ7t|jƒ|jd|jjƒƒWdQXWdQXdS(NRFiÿÿÿÿ(RR"R!RRR8R;(R((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyRm¨s
(RRR<t__test__R!RIRm(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyR±›s		cCsìtjƒ}|jtjtƒƒ|jtjtƒƒ|jtjtƒƒ|jtjtƒƒ|jtjtƒƒ|jtjt	ƒƒ|jtjt
ƒƒ|jtjtƒƒ|jtjtƒƒ|jtjt
ƒƒ|S(N(tunittestt	TestSuitetaddTestt	makeSuiteRaRcR±RRqR‚RŸR¡R©R«(tsuite((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyt
test_suite®st__main__tdefaultTestR¹(6Rt
contextlibR R(tstringRR‘R#R¦t	unittest2R´Rtkeyring.backendR8t
ascii_letterstdigitstALPHABETt
whitespacetpunctuationRVR~RtcontextmanagerRR"R%R.R4R7R=R>R@RARERGRHt
skipUnlesstTestCaseRaRcRqRrRvRR‚RŽRŸR¡R©R«R±R¹Rtmain(((s>/usr/lib/python2.7/dist-packages/keyring/tests/test_backend.pyt<module>s|
												:		0	
						

Youez - 2016 - github.com/yon3zu
LinuXploit