コード例 #1
0
def test_server_id_can_be_anything():
    for sid in ("toto", 0, None):
        oas = OAServer(sid)
        assert oas.server_id() == sid

    oas = OAServer("toto")
    oas.set_server_id(1)
    assert oas.server_id() == 1
コード例 #2
0
def test_server_id_cannot_change_once_registered():
    oas = OAServer(0)
    oas.registered()
    assert_raises(AssertionError, lambda: oas.set_server_id("toto"))