BritishGeologicalSurvey / etlhelper

ETL Helper is a Python ETL library to simplify data transfer into and out of databases.
https://britishgeologicalsurvey.github.io/etlhelper/
GNU Lesser General Public License v3.0
105 stars 25 forks source link

Further testing #60

Closed dvalters closed 4 years ago

dvalters commented 4 years ago

Summary

See coverage html.

volcan01010 commented 4 years ago

Something like this should test the argparse:

# Arrange
mock_setup_oracle_client_function = Mock()
monkeypatch.setattr(soc, 'setup_oracle_client', mock_setup_oracle_client_function)
monkeypatch.setattr(sys, 'argv', ['setup_oracle_client', '-z', 'http://some.url', '--reinstall', '-v'])

# Act (call main from setup_oracle_client module)
main()

# Assert
mock_setup_oracle_client.assert_called_with(...)

Tests could cover with and without --zip-location and --reinstall.

volcan01010 commented 4 years ago

This work was completed in #55.