コード例 #1
0
def test_correct_setup():
    database = Database(SCRAPER_TEST_DB_NAME)
    assert not database.retrieve_table_data("events")
    assert not database.retrieve_table_data("discussions")
    assert not database.retrieve_table_data("beatmapsets")
    assert not database.retrieve_table_data("users")
    assert not database.retrieve_table_data("beatmapset_modes")
コード例 #2
0
ファイル: general_commands.py プロジェクト: Naxesss/Aiess
def retrieve_with_timeout(db_name,
                          table,
                          where="TRUE",
                          selection="*",
                          group_by: str = None,
                          order_by: str = None,
                          limit: int = None):
    try:
        db = Database(db_name)
        return db.retrieve_table_data(table=table,
                                      where=where,
                                      selection=selection,
                                      group_by=group_by,
                                      order_by=order_by,
                                      limit=limit)[0][0]
    except TimeoutError:
        return "(timed out)"