testcontainers-python
testcontainers-python copied to clipboard
Make DockerCompose.get_service_info public
I'm new to Python. I welcome every suggestion. :)
Codecov Report
Merging #240 (d879694) into master (b65c8a0) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #240 +/- ##
=======================================
Coverage 86.05% 86.05%
=======================================
Files 27 27
Lines 746 746
Branches 70 70
=======================================
Hits 642 642
Misses 80 80
Partials 24 24
Impacted Files | Coverage Δ | |
---|---|---|
testcontainers/compose.py | 98.36% <100.00%> (ø) |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
In the future it would make sense to depreciate the get_host and get_port methods in favour of this.
hi @csikb unfortunately this module has changed and your PR doesn't land so neatly - feel free to reply to this issue if this API is not sufficient as it seems to be similar in intent: with DockerCompose() as d: d.get_container(service_name).get_publisher(by_port=port)
API.
it returns this object which contains the URL
and PublishedPort
https://github.com/testcontainers/testcontainers-python/blob/5bef18a51360a2d74ba393f86b753abdf9ec5636/core/testcontainers/compose/compose.py#L29-L38
unfortunately it doesn't quite work as expected on #457 (we normalize the host in the public API of the module), arguably we should normalize it "sooner"?