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 __get__(self, obj, objtype): return Password(StringProperty.__get__(self, obj, objtype))
def make_value_from_datastore(self, value): p = Password(value) return p
def __set__(self, obj, value): p = Password() p.set(value) ScalarProperty.__set__(self, obj, p)
def __get__(self, obj, objtype): return Password(ScalarProperty.__get__(self, obj, objtype))
def decode_password(self, value): value = self.get_text_value(value) return Password(value)