Exemplo n.º 1
0
def test_unregister():
    backend.USERS[1] = ""
    try:
      asyncio.run(backend.unregister(1))

      ''' AttributeError is from not passing in correct parameter for another function, but we're not worried about that
    testing that function here '''
    except AttributeError:
      pass
    assert len(backend.USERS) == 0
Exemplo n.º 2
0
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')
Exemplo n.º 3
0
 def m_unregister(self, cookie):
     backend.unregister(cookie)