From db4775725f1beed9dfe3d6f83acb00c56789efa8 Mon Sep 17 00:00:00 2001 From: Archana Pandey Date: Fri, 2 Aug 2024 18:04:37 +0530 Subject: [PATCH] feat: adding property to return insights-client version --- pytest_client_tools/insights_client.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pytest_client_tools/insights_client.py b/pytest_client_tools/insights_client.py index b80fe77..faa6f61 100644 --- a/pytest_client_tools/insights_client.py +++ b/pytest_client_tools/insights_client.py @@ -237,6 +237,20 @@ def core_version(self): assert m return Version(m.group(1)) + @property + def client_version(self): + """ + Return the version of insights-client as + [`Version`][pytest_client_tools.util.Version] object. + + :return: The version of the insights-client in use. + :rtype: pytest_client_tools.util.Version + """ + proc = self.run("--version") + m = re.search(r"^Client: (.+)+$", proc.stdout, re.MULTILINE) + assert m + return Version(m.group(1)) + @property def uuid(self): """