compute-tooling / compute-studio-kit

Python toolkit to help developers test their models against the COMP interface
MIT License
3 stars 2 forks source link

Compute Studio criteria and api changes #4

Closed hdoupe closed 5 years ago

hdoupe commented 5 years ago

Criteria Changes:

Package name changes:

Tests API Changes:

compute-studio-kit now uses a test class that integrates better with pytest. Define your tests like this (of course, csk-init will write a template in test_functions.py to help you get started):

class TestFunctions1(CoreTestFunctions):
    get_version = functions.get_version
    get_inputs = functions.get_inputs
    validate_inputs = functions.validate_inputs
    run_model = functions.run_model
    ok_adjustment = OK_ADJUSTMENT
    bad_adjustment = BAD_ADJUSTMENT

This produces output:

(taxbrain-dev) hdoupe@pop-os:~/Documents/Tax-Brain$ py.test cs-config/ -v
==================================================== test session starts =====================================================
platform linux -- Python 3.7.3, pytest-5.1.2, py-1.8.0, pluggy-0.13.0 -- /home/hdoupe/anaconda3/envs/taxbrain-dev/bin/python
cachedir: .pytest_cache
rootdir: /home/hdoupe/Documents/Tax-Brain/cs-config
collected 12 items                                                                                                           

cs-config/cs_config/tests/test_functions.py::TestFunctions1::test_all_data_specified PASSED
cs-config/cs_config/tests/test_functions.py::TestFunctions1::test_get_version PASSED
cs-config/cs_config/tests/test_functions.py::TestFunctions1::test_get_inputs PASSED
cs-config/cs_config/tests/test_functions.py::TestFunctions1::test_validate_inputs PASSED
cs-config/cs_config/tests/test_functions.py::TestFunctions1::test_run_model PASSED
cs-config/cs_config/tests/test_functions.py::TestFunctions2::test_all_data_specified PASSED
cs-config/cs_config/tests/test_functions.py::TestFunctions2::test_get_version PASSED
cs-config/cs_config/tests/test_functions.py::TestFunctions2::test_get_inputs PASSED
cs-config/cs_config/tests/test_functions.py::TestFunctions2::test_validate_inputs PASSED
cs-config/cs_config/tests/test_functions.py::TestFunctions2::test_run_model PASSED
cs-config/cs_config/tests/test_functions.py::test_convert_adj PASSED
cs-config/cs_config/tests/test_functions.py::test_convert_adj_w_index PASSED

====================================================== warnings summary ======================================================
...
========================================= 12 passed, 6 warnings in 679.15s (0:11:19) =========================================
(taxbrain-dev) hdoupe@pop-os:~/Documents/Tax-Brain$ py.test cs-config/ -v
hdoupe commented 5 years ago

These changes were implemented in PR #3. This issue will remain open while projects are swapping over to the new API and criteria.