| 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 : |
ó
F+ÞOc @ s d Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l
Z d Z d Z d Z
d e j j f d „ ƒ YZ d e f d „ ƒ YZ d
e j f d „ ƒ YZ d e j f d
„ ƒ YZ d „ Z e d k re j d d ƒ n d S( s3
test_core.py
Created by Kang Zhang on 2009-08-09
iÿÿÿÿNs This is passwords This is password2s
keyringrc.cfgt TestKeyringc B s) e Z d Z d „ Z d „ Z d „ Z RS( s A faked keyring for test.
c C s d S( Ni ( ( t self( ( s; /usr/lib/python2.7/dist-packages/keyring/tests/test_core.pyt supported s c C s t S( N( t
PASSWORD_TEXT( R t servicet username( ( s; /usr/lib/python2.7/dist-packages/keyring/tests/test_core.pyt get_password s c C s d S( Ni ( ( R R R t password( ( s; /usr/lib/python2.7/dist-packages/keyring/tests/test_core.pyt set_password s ( t __name__t
__module__t __doc__R R R ( ( ( s; /usr/lib/python2.7/dist-packages/keyring/tests/test_core.pyR s t TestKeyring2c B s e Z d Z d „ Z RS( s$ Another faked keyring for test.
c C s t S( N( t PASSWORD_TEXT_2( R R R ( ( s; /usr/lib/python2.7/dist-packages/keyring/tests/test_core.pyR $ s ( R R
R R ( ( ( s; /usr/lib/python2.7/dist-packages/keyring/tests/test_core.pyR ! s t CoreTestCasec B s, e Z d „ Z d „ Z d „ Z d „ Z RS( c C s9 t j j d d d ƒ | j t j j d d ƒ d ƒ d S( s0 Test the basic function of the keyring.
t testt usert passtestN( t keyringt coreR t assertEqualR ( R ( ( s; /usr/lib/python2.7/dist-packages/keyring/tests/test_core.pyt test_set_get_password( s c C sL t j j t ƒ ƒ t j j d d d ƒ | j t j j d d ƒ t ƒ d S( s5 Test the function of set keyring in runtime.
R R R N( R R t set_keyringR R R R R ( R ( ( s; /usr/lib/python2.7/dist-packages/keyring/tests/test_core.pyt test_set_keyring_in_runtime. s c C sž t t d ƒ } | j d d t j j t j j t ƒ ƒ d g ƒ | j ƒ t j
j ƒ t j
j d d d ƒ | j
t j
j d d ƒ t ƒ t j t ƒ d S( s1 Test setting the keyring by config file.
t ws
[backend]
s keyring-path= %s
s' default-keyring=test_core.TestKeyring2
R R R N( t opent KEYRINGRCt
writelinest ost patht dirnamet abspatht __file__t closeR R t init_backendR R R R
t remove( R t config_file( ( s; /usr/lib/python2.7/dist-packages/keyring/tests/test_core.pyt test_set_keyring_in_config7 s
c C sS t j ƒ } t j ƒ } t j | ƒ t j j t j j d ƒ d ƒ } t j j | ƒ ru t j | | d ƒ t
} n t } t j
j ƒ t j j | d ƒ } t | d ƒ } | j d ƒ | j ƒ t j
j ƒ t j j | d ƒ } t | d ƒ } | j d ƒ | j ƒ t j
j ƒ t j | ƒ t j | ƒ | rOt j | d | ƒ n d S( Nt ~s
keyringrc.cfgs .oldR s [keyring]s [backend]( t tempfilet mkdtempR t getcwdt chdirR t joint
expandusert existst renamet Truet FalseR R t load_configR t writeR! t shutilt rmtree( R t tempdirt old_locationt personal_cfgt personal_renamedt cfgt f( ( s; /usr/lib/python2.7/dist-packages/keyring/tests/test_core.pyt test_load_configM s.
!
( R R
R R R% R; ( ( ( s; /usr/lib/python2.7/dist-packages/keyring/tests/test_core.pyR ' s t LocationTestCasec B s‡ e Z e j j d ƒ Z e j j e j j j
ƒ d ƒ Z e j
e j j e ƒ d ƒ e j
e j j e ƒ d e ƒ ƒ d „ ƒ ƒ Z RS( s ~/keyringrc.cfgs
keyringrc.cfgs7 Location test requires non-existence of ~/keyringrc.cfgs8 Location test requires non-existence of %(new_location)sc C sK t | j d ƒ } | j d ƒ Wd QXt j d d g } t j | d t j d t j ƒ} | j ƒ \ } } | j d k sˆ t
| ƒ ‚ zk t j j
| j ƒ s§ t
‚ t j j
| j ƒ s t
‚ t | j ƒ } d | j ƒ k sì t
‚ Wd QXWd t j j
| j ƒ rt j | j ƒ n t j j
| j ƒ rFt j | j ƒ n Xd S(
s¤
When starting the keyring module and ~/keyringrc.cfg exists, it
should be moved and the user should be informed that it was
moved.
R s [test config]
Ns -csP import sys; sys.path.remove(""); import keyring.core; keyring.core.load_config()t stderrt stdouti s test config( R t legacy_locationR2 t syst
executablet
subprocesst Popent PIPEt communicatet
returncodet AssertionErrorR R R- t new_locationt readR# ( R R: t cmdt procR>