def test_add_existing_connection():
    db_url = Config.get('app_schema').get('db_connection')
    adapter = DatabaseAdapter()
    adapter.add_connection(db_url)
    expected_length = len(adapter.get_connections())
    adapter.add_connection(db_url)
    assert len(adapter.get_connections()) == expected_length
def test_add_connection_fail():
    adapter = DatabaseAdapter()
    with pytest.raises(ArgumentError):
        adapter.add_connection('not_a_connection_string')
def test_add_connection():
    db_url = Config.get('app_schema').get('db_connection')
    adapter = DatabaseAdapter()
    adapter.add_connection(db_url)
    assert isinstance(adapter.get_session(db_url), Session)