How to use the etlhelper.db_params.DbParams function in etlhelper

To help you get started, we’ve selected a few etlhelper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BritishGeologicalSurvey / etlhelper / test / unit / test_db_params.py View on Github external
def test_db_params_repr():
    """Test DbParams string representation"""
    test_params = DbParams(
        dbtype='PG',
        host='localhost',
        port=5432,
        dbname='etlhelper',
        user='etlhelper_user')
    result = str(test_params)
    expected = ("DbParams(host='localhost', "
                "port='5432', dbname='etlhelper', "
                "user='etlhelper_user', dbtype='PG')")
    assert result == expected
github BritishGeologicalSurvey / etlhelper / test / unit / test_db_params.py View on Github external
def test_db_params_copy():
    """
    Test db_params can copy themselves.
    """
    # Arrange
    test_params = DbParams(
        dbtype='PG',
        host='localhost',
        port=5432,
        dbname='etlhelper',
        user='etlhelper_user')

    # Act
    test_params2 = test_params.copy()

    # Assert
    assert test_params2 == test_params
    assert test_params2 is not test_params
    assert isinstance(test_params2, DbParams)
github BritishGeologicalSurvey / etlhelper / test / unit / test_db_params.py View on Github external
def test_db_params_validate_params():
    with pytest.raises(ETLHelperDbParamsError, match=r'.* not in valid types .*'):
        DbParams(dbtype='not valid')