Ejemplo n.º 1
0
def test_result_table_up2date_with_plugins():
    responses.add_callback(
        responses.POST,
        "https://pretalx.com/.update_check/",
        callback=request_callback_with_plugin,
        content_type="application/json",
    )
    update_check.apply(throw=True)
    tbl = check_result_table()
    assert tbl[0] == ("pretalx", __version__, "1.0.0", True)
    assert tbl[1] == ("Plugin: test plugin for pretalx", "0.0.0", "1.1.1",
                      True)
Ejemplo n.º 2
0
def test_result_table_up2date():
    responses.add_callback(
        responses.POST,
        "https://pretalx.com/.update_check/",
        callback=request_callback_not_updatable,
        content_type="application/json",
    )
    update_check.apply(throw=True)
    tbl = check_result_table()
    assert tbl[0] == ("pretalx", __version__, "1.0.0", False)
    assert any(e[0] == "Plugin: test plugin for pretalx" for e in tbl)
    assert any(e[2] == "?" for e in tbl)
Ejemplo n.º 3
0
def test_result_table_with_error():
    gs = GlobalSettings()
    gs.settings.update_check_result = '{"error": "errororor"}'
    assert check_result_table() == {"error": "errororor"}
Ejemplo n.º 4
0
def test_result_table_empty():
    assert check_result_table() == {"error": "no_result"}
Ejemplo n.º 5
0
 def result_table(self):
     return check_result_table()