Skip to content

Commit

Permalink
#108 Supplied the bucketfs service name to the bfs Service constructo…
Browse files Browse the repository at this point in the history
…r. (#109)
  • Loading branch information
ahsimb authored May 31, 2024
1 parent ce6fb63 commit ef2a391
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

* #103 Enabled SaaS connections for both the database and the BucketFS.
* #105 Added the new configuration element - storage_backend.
* #108 Supplied the BucketFS service name when opening an on-prem bucketfs bucket.

2 changes: 1 addition & 1 deletion exasol/nb_connector/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def open_bucketfs_connection(conf: Secrets) -> bfs.BucketLike:
}

# Connect to the BucketFS service and navigate to the bucket of choice.
bucketfs = bfs.Service(buckfs_url, buckfs_credentials, verify)
bucketfs = bfs.Service(buckfs_url, buckfs_credentials, verify, conf.get(CKey.bfs_service))
return bucketfs[conf.get(CKey.bfs_bucket)]

else:
Expand Down
13 changes: 9 additions & 4 deletions test/unit/test_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def conf(mock_conf) -> Secrets:
mock_conf.save(CKey.bfs_port, "6666")
mock_conf.save(CKey.bfs_user, "buck_user")
mock_conf.save(CKey.bfs_password, "buck_pwd")
mock_conf.save(CKey.bfs_service, "buck_svc")
mock_conf.save(CKey.bfs_bucket, "my_bucket")

return mock_conf
Expand Down Expand Up @@ -192,7 +193,8 @@ def test_open_bucketfs_connection(mock_bfs_service, conf):
"password": conf.get(CKey.bfs_password),
}
},
False
False,
conf.get(CKey.bfs_service)
)


Expand All @@ -208,7 +210,8 @@ def test_open_bucketfs_connection_https_no_verify(mock_bfs_service, conf):
"password": conf.get(CKey.bfs_password),
}
},
False
False,
conf.get(CKey.bfs_service)
)


Expand All @@ -225,7 +228,8 @@ def test_open_bucketfs_connection_https_verify(mock_bfs_service, conf):
"password": conf.get(CKey.bfs_password),
}
},
True
True,
conf.get(CKey.bfs_service)
)


Expand All @@ -244,7 +248,8 @@ def test_open_bucketfs_connection_trust_ca_file(mock_bfs_service, conf):
"password": conf.get(CKey.bfs_password),
}
},
tmp_file.name
tmp_file.name,
conf.get(CKey.bfs_service)
)


Expand Down

0 comments on commit ef2a391

Please sign in to comment.