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)
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)
def test_result_table_with_error(): gs = GlobalSettings() gs.settings.update_check_result = '{"error": "errororor"}' assert check_result_table() == {"error": "errororor"}
def test_result_table_empty(): assert check_result_table() == {"error": "no_result"}
def result_table(self): return check_result_table()