pyESM-project / pyesm

Python based Input-output general purpose system modelling framework
Apache License 2.0
3 stars 0 forks source link

testing units and integrations #40

Open Mast86 opened 2 months ago

Mast86 commented 2 months ago

testing units to be completed one by one in spear time.

testing integrations more complex. for the moment, test_workflow has defined, testing generation of model instance from existing data and setup files as a fixture, then testing the Model class more relevant APIs that takes model instance as argument.

Tests pass only if no errors are raised. So no checks are made on expected data in sqlite database yet.

Conceptual cases can be added to default problems in test folder, so all these tests will be executed on all conceptual cases.

Mast86 commented 2 months ago

@LorenzoRinaldi you can develop conceptual cases as you are used to do. but in the end you can put all setup and data files into a dedicated test folder to automatically test the case.

Mast86 commented 1 month ago

@LorenzoRinaldi @valebii
update: gli integration tests ora testano tutti i modelli nelle sottocartelle default/.

riorganizzazione necessaria (ne parliamo in settimana e riordiniamo le idee): pedice 0 : cartelle dei testi strutturali (costanti, equazioni, generazione variabili/problemi con casi particolari) pedici da 1 in avanti: tipologie di modelli che testano specifiche complessità (facciamo una lista..).

idea per testare i risultati: creare una copia del database dei risultati, database_expected_results.db, che è fisso e che sarà confrontato con i risultati del test operativo. creare altro metodo test_results.py che controlli la coerenza tra risultati ottenuti dal test_workflow e database coi risultati attesi. serve metodo per check uguaglianza database (in SQLManager class aggiungo un task)

Mast86 commented 1 month ago

test equality of databases between the one calculated and the one "expected".