Closed aripollak closed 4 months ago
Happy to add unit tests where appropriate, but I'm a little confused; is there a place that would make sense to add them now?
On a second look a different approach is possible in this particular case.
compose_run()
contains a lot of argument processing that could be moved to a separate function (basically everything here https://github.com/containers/podman-compose/blob/main/podman_compose.py#L2419C39-L2455C42). Then we could add unit tests for that function.
Same with compose_exec()
.
@p12tic how does it look now? Specfying all the expected args in the passed argparse.Namespaces
in the tests seemed a little duplicative, but that felt more appropriate for a unit test than calling into PodmanCompose._parse_args()
. I think the interface of compose_run_update_container_from_args()
would be more ideal if it wasn't changing the container dict in-place, but I'm not familiar enough with the code to go and change it too much.
@aripollak I agree with the entirety of your comment.
The PR looks good, thanks!
Fixes: #798