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())
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())
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())
def __set__(self, obj, value): if not isinstance(value, Password): p = Password() p.set(value) value = p Property.__set__(self, obj, value)
def __set__(self, obj, value): p = Password() p.set(value) ScalarProperty.__set__(self, obj, p)