Exemplo n.º 1
0
def register_test(data):
    gs = GameSession()
    gs.loginManager.o.un(u"villain")
    gs.loginManager.o.pwd(u"rule the world!")
    gs.loginManager.o.register(gs.loginManager)
    assert gs.model() == "game", gs.model()
    gs.logout()
    assert gs.model() == "login", gs.model()
Exemplo n.º 2
0
def login_test(data):
    gs = GameSession()

    gs.loginManager.o.un(u"hero")
    gs.loginManager.o.pwd(u"hero")
    gs.loginManager.o.login(gs.loginManager)

    assert gs.model() == "game", gs.model()
Exemplo n.º 3
0
def register_test(data):
    gs = GameSession()
    gs.loginManager.o.un(u"villain")
    gs.loginManager.o.pwd(u"rule the world!")
    gs.loginManager.o.register(gs.loginManager)
    assert gs.model() == "game", gs.model()
    gs.logout()
    assert gs.model() == "login", gs.model()
Exemplo n.º 4
0
def login_test(data):
    gs = GameSession()
    
    gs.loginManager.o.un(u"hero")
    gs.loginManager.o.pwd(u"hero")
    gs.loginManager.o.login(gs.loginManager)
    
    assert gs.model() == "game", gs.model()
Exemplo n.º 5
0
def login_fail(data):
    gs = GameSession()

    gs.loginManager.o.un(u"hero")
    gs.loginManager.o.pwd(u"wrong pwd")
    gs.loginManager.o.login(gs.loginManager)
    assert gs.model() == "login", gs.model()

    gs.loginManager.o.un(u"random")
    gs.loginManager.o.pwd(u"wrong pwd")
    gs.loginManager.o.login(gs.loginManager)
    assert gs.model() == "login", gs.model()
Exemplo n.º 6
0
def login_fail(data):
    gs = GameSession()
    
    gs.loginManager.o.un(u"hero")
    gs.loginManager.o.pwd(u"wrong pwd")
    gs.loginManager.o.login(gs.loginManager)
    assert gs.model() == "login", gs.model()

    gs.loginManager.o.un(u"random")
    gs.loginManager.o.pwd(u"wrong pwd")
    gs.loginManager.o.login(gs.loginManager)
    assert gs.model() == "login", gs.model()