def get_passwords(self, cookie, args): ''' args is a dict with possible keys: name, type, updated, expiration, account ''' p = backend.get_passwords_by(cookie, **args) return [i for i in p]
def testbackend(): ''' backend ''' import backend as b b.register('dani2', 'pass') assert b.check_user_name('dani2') c = b.auth('dani2', 'password', password='******') b.set_password(c, 'nuevo', 'xxxx', type='email', account='danigm', description="http://mail.danigm.net") p = b.get_password(c, 'nuevo') assert p.name == 'nuevo' b.del_password(c, 'nuevo') p = b.get_passwords_by(c, name='nuevo') assert not p b.unregister(c) assert not b.check_user_name('dani2')