dieterich-lab / scimodom

Sci- ModoM: A quantitative database of transcriptome-wide high-throughput RNA modification sites
https://dieterich-lab.github.io/scimodom/
GNU Affero General Public License v3.0
0 stars 0 forks source link

CLI improvements take 2 #145

Open eboileau opened 2 months ago

eboileau commented 2 months ago

A clear and concise description of todo items.

eboileau commented 4 days ago

We would also like to add CLI tests, something like

from scimodom.app import create_app
# w/ a redefinition of the config for testing
@pytest.fixture
def app():
    app = create_app()
    yield app

does not work for testing, because of setup_service.upsert_all() which does not work with sqlite

sqlalchemy.exc.UnsupportedCompilationError: Compiler <sqlalchemy.dialects.sqlite.base.SQLiteCompiler object at 0x7fa1256e2fd0> can't render element of type <class 'sqlalchemy.dialects.mysql.dml.OnDuplicateClause'> (Background on this error at: https://sqlalche.me/e/20/l7de)

We could try registering-commands-with-blueprints, this might work then with

@pytest.fixture()
def runner(app):
    return app.test_cli_runner()

but this needs to be tested (we want to have the application context pushed). Otherwise, we might just as well try custom scripts.