diff --git a/python_on_whales/components/context/cli_wrapper.py b/python_on_whales/components/context/cli_wrapper.py index 625510cf..9f2af125 100644 --- a/python_on_whales/components/context/cli_wrapper.py +++ b/python_on_whales/components/context/cli_wrapper.py @@ -231,3 +231,4 @@ def use(self, context: ValidContext): """ full_cmd = self.docker_cmd + ["context", "use", context] run(full_cmd) + return self.inspect(context) diff --git a/tests/python_on_whales/components/test_context.py b/tests/python_on_whales/components/test_context.py index e85fcf49..0160885d 100644 --- a/tests/python_on_whales/components/test_context.py +++ b/tests/python_on_whales/components/test_context.py @@ -48,6 +48,10 @@ def test_use_context(): docker.context.use("default") +def test_use_context_returns(): + assert docker.context.use("default") == docker.context.inspect("default") + + def test_remove_empty_context_list(): all_contexts = set(docker.context.list()) docker.context.remove([])