Exemplo n.º 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())
Exemplo n.º 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())
Exemplo n.º 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())
Exemplo n.º 4
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())
Exemplo n.º 5
0
 def __set__(self, obj, value):
     if not isinstance(value, Password):
         p = Password()
         p.set(value)
         value = p
     Property.__set__(self, obj, value)
Exemplo n.º 6
0
 def __get__(self, obj, objtype):
     return Password(StringProperty.__get__(self, obj, objtype))
Exemplo n.º 7
0
 def __set__(self, obj, value):
     if not isinstance(value, Password):
         p = Password()
         p.set(value)
         value = p
     Property.__set__(self, obj, value)
Exemplo n.º 8
0
 def make_value_from_datastore(self, value):
     p = Password(value)
     return p
Exemplo n.º 9
0
 def __set__(self, obj, value):
     p = Password()
     p.set(value)
     ScalarProperty.__set__(self, obj, p)
Exemplo n.º 10
0
 def __set__(self, obj, value):
     p = Password()
     p.set(value)
     ScalarProperty.__set__(self, obj, p)
Exemplo n.º 11
0
 def __get__(self, obj, objtype):
     return Password(ScalarProperty.__get__(self, obj, objtype))
Exemplo n.º 12
0
 def decode_password(self, value):
     value = self.get_text_value(value)
     return Password(value)