예제 #1
0
    def test_constructor(self):
        hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg)

        password = Password(hashfunc=hmac_hashfunc)
        password.set('foo')
        self.assertEquals(password.str,
                          hmac.new(b'mysecretkey', b'foo').hexdigest())
예제 #2
0
    def test_constructor(self):
        hmac_hashfunc = lambda msg: hmac.new(b'mysecretkey', msg)

        password = Password(hashfunc=hmac_hashfunc)
        password.set('foo')
        self.assertEquals(password.str,
                          hmac.new(b'mysecretkey', b'foo').hexdigest())
예제 #3
0
    def test_constructor(self):
        from boto.utils import Password
        import hmac

        hmac_hashfunc = lambda msg: hmac.new('mysecretkey', msg )

        password = Password(hashfunc=hmac_hashfunc)
        password.set('foo')
        self.assertEquals(password.str, hmac.new('mysecretkey','foo').hexdigest())
예제 #4
0
파일: test_password.py 프로젝트: 2uinc/boto
    def test_constructor(self):
        from boto.utils import Password
        import hmac

        hmac_hashfunc = lambda msg: hmac.new('mysecretkey', msg )

        password = Password(hashfunc=hmac_hashfunc)
        password.set('foo')
        self.assertEquals(password.str, hmac.new('mysecretkey', 'foo').hexdigest())
예제 #5
0
파일: property.py 프로젝트: timjdavey/boto
 def __set__(self, obj, value):
     if not isinstance(value, Password):
         p = Password()
         p.set(value)
         value = p
     Property.__set__(self, obj, value)
예제 #6
0
 def __set__(self, obj, value):
     if not isinstance(value, Password):
         p = Password()
         p.set(value)
         value = p
     Property.__set__(self, obj, value)
예제 #7
0
파일: property.py 프로젝트: carlgao/lenga
 def __set__(self, obj, value):
     p = Password()
     p.set(value)
     ScalarProperty.__set__(self, obj, p)
예제 #8
0
 def __set__(self, obj, value):
     p = Password()
     p.set(value)
     ScalarProperty.__set__(self, obj, p)